diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..152a307 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,74 @@ +# This workflow will upload a Python Package using the PyPi action workflow + +name: Upload Python Package + +on: + release: + types: [published] + +env: + SKIP_GENERATE_AUTHORS: 1 + SKIP_WRITE_GIT_CHANGELOG: 1 + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + py_version: ["3.9"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.py_version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.py_version }} + - name: Install dependencies + run: | + pip install --upgrade setuptools pip + - name: Install package and requirements + run: | + pip install --upgrade . + pip install -r requirements-tests.txt + - name: Run pytest with codecoverage + run: | + coverage run --source=hypothesis_networkx $(which pytest) --hypothesis-show-statistics + coverage report + codecov + + deploy: + needs: [build] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + pip install pbr + + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..d5a7e31 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,60 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: test package + +on: + push: + branches: [ master ] + pull_request: + +env: + SKIP_GENERATE_AUTHORS: 1 + SKIP_WRITE_GIT_CHANGELOG: 1 + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.py_version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.py_version }} + - name: Install dependencies + run: | + pip install --upgrade setuptools pip + - name: Install package and requirements + run: | + pip install --upgrade . + pip install -r requirements-tests.txt + - name: Run pytest with codecoverage + run: | + coverage run --source=hypothesis_networkx $(which pytest) --hypothesis-show-statistics + coverage report + codecov + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + pip install --upgrade setuptools pip + pip install -r requirements-tests.txt + pip install --upgrade . + - name: Run pylint + run: | + pylint --disable=fixme --fail-under=8.0 hypothesis_networkx tests + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5bb9794..0000000 --- a/.travis.yml +++ /dev/null @@ -1,74 +0,0 @@ -language: python -dist: xenial -cache: pip - - -env: - global: - - SKIP_GENERATE_AUTHORS=1 - - SKIP_WRITE_GIT_CHANGELOG=1 - matrix: - - CODECOV=true -before_install: - - pip install --upgrade pip setuptools pbr -install: - - pip install --upgrade . -before_script: - - pip install --upgrade codecov pytest-cov pytest -script: - - pytest --cov=hypothesis_networkx --hypothesis-show-statistics -after_success: - - if [[ ${CODECOV} == true ]]; then codecov; fi - -branches: - only: - - master - - /^v\d+\.\d+(\.\d+)?(\.0(a|b|c)\d+)?(\.dev\d+)?$/ # Tags - -jobs: - fast_finish: true - allow_failures: - - python: "3.5-dev" - - python: "3.6-dev" - - python: "3.7-dev" - - python: "3.8-dev" - include: - - python: "3.5" - - python: "3.6" - - python: "3.7" - - python: "3.5-dev" - - python: "3.6-dev" - - python: "3.7-dev" - - python: "3.8-dev" - env: CODECOV=false - -# - stage: docs -# python: "3.5" -# addons: skip -# install: -# - pip install --upgrade -r requirements-docs.txt -# - pip install --upgrade .[full] -# # script: python setup.py build_sphinx -# script: mkdir -p doc/source/_static; sphinx-build -EnW -b html doc/source/ doc/build/html -# after_success: skip - -# - stage: pylint -# python: "3.5" -# addons: skip -# install: -# - pip install pylint -# script: -# - python run_pylint.py --disable=fixme --fail-under=8.5 vermouth -# - python run_pylint.py --disable=fixme --fail-under=9.5 bin/martinize2 -# after_success: skip - - stage: deploy - python: "3.8" - script: skip - deploy: - user: pckroon - password: - # travis encrypt --add deploy.password - secure: hZ3wetU8fU24cCZ9VMq+ZJ9yyGnS6EzrA6jZ3KoHUI+3Z2jj2V6IqZVdo9WFG9AbI23DC1bvVj4/8hAdRwzLclkeXo05gotysNM+WlzpJpBtoIMpXn3OKzIkU/LScKP/IDu0EvapzmSUM4Q5qonmw46ybhRNNFdzvDRO2v1FYSjMaAuLtNdwjkXiBnU524tB71lx8/rjK4HZamxXYtAQbISaxWOxnu8gDwFcB7Ed58P823FHlEOhDi8qmI65p70KqWbzmCKF7O2PEY7JnUgFhjRkTcHIMzwYA6iUlGYQMs8jQRtHOlZCIcZItt3koFssNQ9jPBA/RpMHREiNObxra2m/xjv2r/Pneb9Nk2RFX9pn3x3+kglUOIXltTDYEDRv98xnP8O39Y4F+/Bx4s2E8C5FhNbcD1DAHqFppIihzRd/d+csVuChRLMYLwTG3GvPlaK4lSb2LlkDlTBrB6FvOYmAiMg39oiuAnPP5JObV8MP/0mE5B8ex/D0lkv9xUgNZE11uSqmqLzpu2wDG8VPo+FCNX/1UlULBGePeZMsH6SpUuzHyDYhcIMtarXGwanNIecWHgKGVBPGry4Ef5KGhinxAYJqmDXOcec2e3uRrV3jR8LUKJuoEO9eUL0wljunvmlW7xrLb/EfIpI+/CF4Ets+t0gUvJ5jbZBZ+kXYl2Q= - provider: pypi - on: - tags: true diff --git a/requirements-tests.txt b/requirements-tests.txt new file mode 100644 index 0000000..7163a17 --- /dev/null +++ b/requirements-tests.txt @@ -0,0 +1,4 @@ +pytest +pylint +coverage +codecov diff --git a/tests/test_graph_builder.py b/tests/test_graph_builder.py index 4730604..d1cf913 100644 --- a/tests/test_graph_builder.py +++ b/tests/test_graph_builder.py @@ -19,6 +19,7 @@ from hypothesis import given, settings, HealthCheck, note import networkx as nx +import pytest from hypothesis_networkx import graph_builder