diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 53404714..995ec1f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,27 +3,29 @@ name: CI on: push: - branches: ["master", "ci-testing"] + branches: ["main", "master", "ci-testing"] pull_request: - branches: ["master"] + branches: ["main", "master"] workflow_dispatch: jobs: tests: - name: "Python ${{ matrix.python-version }}" - runs-on: "ubuntu-latest" + name: "Python ${{ matrix.python-version }} / ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" env: - USING_COVERAGE: "3.7,3.8" + USING_COVERAGE: "3.7,3.8,3.9" strategy: matrix: + os: [ubuntu-latest, macos-latest, windows-latest] python-version: - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10.0-alpha.5" - "pypy2" # disabled due to one failing test # - "pypy3" @@ -35,7 +37,6 @@ jobs: python-version: "${{ matrix.python-version }}" - name: "Install dependencies" run: | - set -xe python -VV python -msite python -m pip install --upgrade pip setuptools wheel @@ -52,7 +53,6 @@ jobs: - name: "Combine coverage" run: | - set -xe python -m pip install coverage[toml] python -m coverage combine python -m coverage xml @@ -71,7 +71,7 @@ jobs: - uses: "actions/checkout@v2" - uses: "actions/setup-python@v1" with: - python-version: "3.8" + python-version: "3.9" - name: "Install pep517 and twine" run: "python -m pip install pep517 twine" @@ -87,14 +87,14 @@ jobs: matrix: os: ["ubuntu-latest", "windows-latest", "macos-latest"] - name: "Verify dev env" + name: "Verify dev env / ${{ matrix.os }}" runs-on: "${{ matrix.os }}" steps: - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v1" + - uses: "actions/setup-python@v2" with: - python-version: "3.8" + python-version: "3.9" - name: "Install in dev mode" run: "python -m pip install -e .[dev]" - name: "Import package" diff --git a/MANIFEST.in b/MANIFEST.in index 4fc5a7a7..4448559f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include LICENSE.txt *.rst *.md *.toml *.yml *.yaml *.ini -include requirements-* +include requirements* graft .github # Tests diff --git a/changelog.d/135.bugfix.rst b/changelog.d/135.bugfix.rst index 87d1c86c..782d6eed 100644 --- a/changelog.d/135.bugfix.rst +++ b/changelog.d/135.bugfix.rst @@ -1,3 +1,3 @@ -Test coverage is now submitted to codecov.io. +* Test coverage is now submitted to codecov.io. -Fixed by #150 + Fixed by #150 diff --git a/changelog.d/141.feature.rst b/changelog.d/141.feature.rst index d70511b8..a2245144 100644 --- a/changelog.d/141.feature.rst +++ b/changelog.d/141.feature.rst @@ -1 +1 @@ -Adds the tests to the sdist. Fixed by #150 +* Adds the tests to the sdist. Fixed by #150 diff --git a/changelog.d/150.misc.rst b/changelog.d/150.misc.rst index a9f785ef..10684b93 100644 --- a/changelog.d/150.misc.rst +++ b/changelog.d/150.misc.rst @@ -1,5 +1,5 @@ -Revamped the build system significantly. +* Revamped the build system significantly. -* Now uses github actions instead of Travis -* Now uses codecov.io instead of coveralls -* Generally modernized it a bunch + - Now uses github actions instead of Travis + - Now uses codecov.io instead of coveralls + - Generally modernized it a bunch diff --git a/changelog.d/159.misc.rst b/changelog.d/159.misc.rst new file mode 100644 index 00000000..7d94547e --- /dev/null +++ b/changelog.d/159.misc.rst @@ -0,0 +1 @@ +* Changed the development branch from master to main diff --git a/changelog.d/160.feature.rst b/changelog.d/160.feature.rst new file mode 100644 index 00000000..71bf8a80 --- /dev/null +++ b/changelog.d/160.feature.rst @@ -0,0 +1 @@ +* Update the CI to test Python 3.10 diff --git a/changelog.d/162.misc.rst b/changelog.d/162.misc.rst new file mode 100644 index 00000000..8aba4207 --- /dev/null +++ b/changelog.d/162.misc.rst @@ -0,0 +1 @@ +* Restore numpy testing for all modern Pythons diff --git a/changelog.d/163.misc.rst b/changelog.d/163.misc.rst new file mode 100644 index 00000000..dd9c0fd8 --- /dev/null +++ b/changelog.d/163.misc.rst @@ -0,0 +1 @@ +* Verify hamcrest testing on macos and windows diff --git a/requirements.in b/requirements.in new file mode 100644 index 00000000..e7ab444a --- /dev/null +++ b/requirements.in @@ -0,0 +1 @@ +.[dev] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..5a9d2d3b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,204 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --no-emit-index-url --no-emit-trusted-host requirements.in +# +alabaster==0.7.12 + # via sphinx +apipkg==1.5 + # via execnet +appdirs==1.4.4 + # via + # black + # virtualenv +attrs==20.3.0 + # via + # pytest + # pytest-mypy +babel==2.9.0 + # via sphinx +black==20.8b1 + # via pyhamcrest +bleach==3.2.1 + # via readme-renderer +certifi==2020.11.8 + # via requests +chardet==3.0.4 + # via requests +click==7.1.2 + # via + # black + # towncrier +colorama==0.4.4 + # via twine +coverage==5.3 + # via pyhamcrest +distlib==0.3.1 + # via virtualenv +docutils==0.16 + # via + # readme-renderer + # sphinx +execnet==1.7.1 + # via pytest-xdist +filelock==3.0.12 + # via + # pytest-mypy + # tox + # virtualenv +flake8==3.8.4 + # via pyhamcrest +idna==2.10 + # via requests +imagesize==1.2.0 + # via sphinx +incremental==17.5.0 + # via towncrier +iniconfig==1.1.1 + # via pytest +jinja2==2.11.2 + # via + # sphinx + # towncrier +keyring==21.5.0 + # via twine +markupsafe==1.1.1 + # via jinja2 +mccabe==0.6.1 + # via flake8 +mypy-extensions==0.4.3 + # via + # black + # mypy +mypy==0.790 + # via pytest-mypy +packaging==20.4 + # via + # bleach + # pytest + # pytest-sugar + # sphinx + # tox +pathspec==0.8.1 + # via black +pkginfo==1.6.1 + # via twine +pluggy==0.13.1 + # via + # pytest + # tox +py==1.9.0 + # via + # pytest + # pytest-forked + # tox +pycodestyle==2.6.0 + # via flake8 +pyflakes==2.2.0 + # via flake8 +pygments==2.7.2 + # via + # readme-renderer + # sphinx +file:///Users/offby1/projects/PyHamcrest + # via -r requirements.in +pyparsing==2.4.7 + # via packaging +pytest-forked==1.3.0 + # via pytest-xdist +pytest-mypy==0.8.0 + # via pyhamcrest +pytest-sugar==0.9.4 + # via pyhamcrest +pytest-xdist==2.1.0 + # via pyhamcrest +pytest==6.1.2 + # via + # pyhamcrest + # pytest-forked + # pytest-mypy + # pytest-sugar + # pytest-xdist +pytz==2020.4 + # via babel +readme-renderer==28.0 + # via twine +regex==2020.11.13 + # via black +requests-toolbelt==0.9.1 + # via twine +requests==2.25.0 + # via + # requests-toolbelt + # sphinx + # twine +rfc3986==1.4.0 + # via twine +six==1.15.0 + # via + # bleach + # packaging + # readme-renderer + # tox + # virtualenv +snowballstemmer==2.0.0 + # via sphinx +sphinx-rtd-theme==0.5.0 + # via pyhamcrest +sphinx==3.3.1 + # via + # pyhamcrest + # sphinx-rtd-theme +sphinxcontrib-applehelp==1.0.2 + # via sphinx +sphinxcontrib-devhelp==1.0.2 + # via sphinx +sphinxcontrib-htmlhelp==1.0.3 + # via sphinx +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-qthelp==1.0.3 + # via sphinx +sphinxcontrib-serializinghtml==1.1.4 + # via sphinx +termcolor==1.1.0 + # via pytest-sugar +toml==0.10.2 + # via + # black + # pytest + # towncrier + # tox +towncrier==19.2.0 + # via pyhamcrest +tox-asdf==0.1.0 + # via pyhamcrest +tox-pyenv==1.1.0 + # via pyhamcrest +tox==3.20.1 + # via + # pyhamcrest + # tox-asdf + # tox-pyenv +tqdm==4.53.0 + # via twine +twine==3.2.0 + # via pyhamcrest +typed-ast==1.4.1 + # via + # black + # mypy +typing-extensions==3.7.4.3 + # via + # black + # mypy +urllib3==1.26.2 + # via requests +virtualenv==20.2.1 + # via tox +webencodings==0.5.1 + # via bleach + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/setup.py b/setup.py index 41aad08f..1f462338 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,17 @@ def read(fname): REQUIREMENTS_DOCS = ["sphinx~=3.0", "sphinx_rtd_theme~=0.4"] TESTS_BASIC = ["pytest>=5.0", "pytest-sugar", "coverage"] TESTS_NUMPY = ["numpy"] -DEV_TOOLS = ["towncrier", "twine", "pytest-xdist", "pytest-mypy"] +DEV_TOOLS = [ + "towncrier", + "twine", + "pytest-xdist", + "pytest-mypy", + "flake8", + "black", + "tox", + "tox-pyenv", + "tox-asdf", +] params = dict( diff --git a/tox.ini b/tox.ini index 0b4e4ba5..fd5341f8 100644 --- a/tox.ini +++ b/tox.ini @@ -12,16 +12,17 @@ looponfailroots = # Keep docs in sync with docs env and .readthedocs.yml. [gh-actions] python = - 3.6: py36 - 3.7: py37, docs - 3.8: py38, lint, manifest, typing, changelog - 3.9: py39 + 3.6: py36, py36-numpy + 3.7: py37, py37-numpy + 3.8: py38, py38-numpy + 3.9: py39, py39-numpy, lint, manifest, typing, changelog, docs + 3.10: py310 pypy2: pypy2 pypy3: pypy3 [tox] -envlist = typing,lint,py36,py36-numpy,py37,py38,py39,pypy,pypy3,manifest,docs,pypi-description,changelog,coverage-report +envlist = typing,lint,py36{,-numpy},py37{,-numpy},py38{,-numpy},py39{,-numpy},py310{,-numpy},pypy{,-numpy},pypy3{,-numpy},manifest,docs,pypi-description,changelog,coverage-report isolated_build = True @@ -42,6 +43,18 @@ commands = coverage run -m pytest {posargs} extras = tests-numpy commands = python -m pytest {posargs} +[testenv:py37-numpy] +extras = tests-numpy +commands = python -m pytest {posargs} + +[testenv:py38-numpy] +extras = tests-numpy +commands = python -m pytest {posargs} + +[testenv:py39-numpy] +extras = tests-numpy +commands = python -m pytest {posargs} + [testenv:py37] # Python 3.6+ has a number of compile-time warnings on invalid string escapes. # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. @@ -63,8 +76,19 @@ extras = {env:TOX_AP_TEST_EXTRAS:tests} commands = coverage run -m pytest {posargs} +[testenv:py39] +# Python 3.6+ has a number of compile-time warnings on invalid string escapes. +# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. +basepython = python3.9 +install_command = pip install --no-compile {opts} {packages} +setenv = + PYTHONWARNINGS=d +extras = {env:TOX_AP_TEST_EXTRAS:tests} +commands = coverage run -m pytest {posargs} + + [testenv:coverage-report] -basepython = python3.7 +basepython = python3.9 skip_install = true deps = coverage[toml]>=5.0.2 commands = @@ -73,7 +97,7 @@ commands = [testenv:lint] -basepython = python3.8 +basepython = python3.9 skip_install = true deps = pre-commit @@ -84,21 +108,21 @@ commands = [testenv:docs] # Keep basepython in sync with gh-actions and .readthedocs.yml. -basepython = python3.7 +basepython = python3.9 extras = docs commands = sphinx-build -n -T -b html -d {envtmpdir}/doctrees doc doc/_build/html [testenv:manifest] -basepython = python3.8 +basepython = python3.9 deps = check-manifest skip_install = true commands = check-manifest [testenv:pypi-description] -basepython = python3.8 +basepython = python3.9 skip_install = true deps = twine @@ -109,14 +133,14 @@ commands = [testenv:changelog] -basepython = python3.8 +basepython = python3.9 deps = towncrier skip_install = true commands = towncrier --draft [testenv:typing] -basepython = python3.8 +basepython = python3.9 deps = mypy commands = mypy src/