Skip to content

Commit

Permalink
publish to pypi
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Kogan <[email protected]>
  • Loading branch information
pksol committed Aug 10, 2021
1 parent a578f97 commit ca3713e
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 55 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish python distribution to PyPI
on: push

jobs:
build-and-publish-test:
name: Build and publish python distribution to PyPI
runs-on: ubuntu-18.04
continue-on-error: true
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
python_version: '3.7.1'
repository_name: 'pytest_mock_generator'
repository_url: 'https://test.pypi.org/legacy/'
pypi_token: ${{ secrets.test_pypi_password }}
continue-on-error: true
- name: Sleep to allow pypi index to update with the new version
run: sleep 5m
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install poetry
run: make poetry-download
- name: Cleanup
run: |
rm -r pytest_mock_generator
pip uninstall pytest-mock-generator
- name: Perform System tests
run: |
python -m pip install pip==21.0.1
poetry export --dev --without-hashes -f requirements.txt --output test-requirements.txt
pip install -r test-requirements.txt
pip install -i https://test.pypi.org/simple/ pytest-mock-generator
python -m pytest -vvv -k "test_public_api"
export INSTALLED=`pip freeze | grep pytest-mock-generator`
export EXPECTED=`poetry version --short`
if [ "${INSTALLED:23}" != "$EXPECTED" ]; then exit 1; fi
build-and-publish-production:
name: Build and publish python distribution to PyPI
runs-on: ubuntu-18.04
if: startsWith(github.event.ref, 'refs/tags')
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
python_version: '3.7.1'
repository_name: 'pytest_mock_generator'
pypi_token: ${{ secrets.prod_pypi_password }}
continue-on-error: true
- name: Sleep to allow pypi index to update with the new version
run: sleep 5m
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install poetry
run: make poetry-download
- name: Cleanup
run: |
rm -r pytest_mock_generator
pip uninstall pytest-mock-generator
- name: Perform System tests
run: |
python -m pip install pip==21.0.1
poetry export --dev --without-hashes -f requirements.txt --output test-requirements.txt
pip install -r test-requirements.txt
pip install pytest-mock-generator
python -m pytest -vvv -k "test_public_api"
export INSTALLED=`pip freeze | grep pytest-mock-generator`
export EXPECTED=`poetry version --short`
if [ "${INSTALLED:23}" != "$EXPECTED" ]; then exit 1; fi
100 changes: 46 additions & 54 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pytest-mock-generator"
version = "0.1.0"
version = "0.3.0"
description = "A pytest fixture wrapper for https://pypi.org/project/mock-generator"
readme = "README.md"
authors = ["Peter Kogan <[email protected]>"]
Expand Down

0 comments on commit ca3713e

Please sign in to comment.