diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b5b8711 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,91 @@ +# Run tests + +name: Test + +on: + push: + # standalone is an old branch containing a fully functional pypiserver + # executable, from back in the day before docker & a better pip. + branches-ignore: + - standalone + pull_request: {} + + +jobs: + test-cpython: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install tox + - name: Run tests + # Create a tox env specification by stripping the dot out of the version + # specification and appending it to "py" + run: | + tox -e "py$(echo ${{ matrix.python-version }} | tr -d .)" + + test-pypy: + + # Run a a separate job so we don't need to mess with conditionally + # splitting the python version from the build matrix. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: pypy3 + - name: Install dependencies + run: pip install tox + - name: Run tests + run: tox -e pypy3 + + check: + + # These checks only need to be done once, not for every python version we s + # upport + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + # Pretty much any python version will do + python-version: "3.9" + - name: Install dependencies + run: pip install -r "requirements/dev.pip" + - name: Check types + # individual mypy files for now, until we get the rest + # of the project typechecking + run: | + mypy \ + pypiserver/config.py \ + tests/test_init.py + - name: Check formatting + run: black --diff --check . + - name: Validate README + run: ./bin/check_readme.sh + + # Full-flow docker tests, again not python version dependent + docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + # Pretty much any python version will do + python-version: "3.9" + - name: Install dependencies + run: pip install --use-feature 2020-resolver -U twine + - name: Run tests + run: ./bin/test-docker.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 137dec6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -sudo: required -language: python -services: docker - -python: - - 3.6 - - 3.7 - - 3.8 - - 3.9 - - pypy3 - -install: - - pip install -U pip - - pip install --use-feature=2020-resolver -U setuptools twine sphinx tox tox-travis - -script: - - tox - - ./bin/check_readme.sh - -branches: - except: - - standalone - -jobs: - include: - - python: 3.9 - install: pip install -U black - script: black --check . - - python: 3.9 - install: - - pip install -U pip - - pip install --use-feature 2020-resolver -U twine - script: ./bin/test-docker.sh diff --git a/README.rst b/README.rst index c3321f5..29ad0c9 100644 --- a/README.rst +++ b/README.rst @@ -7,13 +7,13 @@ ============================================================================== pypiserver - minimal PyPI server for use with pip/easy_install ============================================================================== -|pypi-ver| |travis-status| |dependencies| |python-ver| |proj-license| +|pypi-ver| |test-status| |dependencies| |python-ver| |proj-license| :Version: 2.0.0dev1 :Date: 2020-10-10 :Source: https://github.com/pypiserver/pypiserver :PyPI: https://pypi.org/project/pypiserver/ -:Travis: https://travis-ci.org/pypiserver/pypiserver +:Tests: https://github.com/pypiserver/pypiserver/actions :Maintainers: Kostis Anagnostopoulos , Matthew Planchard :License: zlib/libpng + MIT @@ -983,10 +983,10 @@ See the ``LICENSE.txt`` file. .. _twine: https://pypi.org/project/twine/ .. _pypi-uploader: https://pypi.org/project/pypi-uploader/ .. _python-pam: https://pypi.org/project/python-pam/ -.. |travis-status| image:: https://travis-ci.org/pypiserver/pypiserver.svg - :alt: Travis build status +.. |test-status| image:: https://github.com/pypiserver/pypiserver/workflows/Test/badge.svg + :alt: test status :scale: 100% - :target: https://travis-ci.org/pypiserver/pypiserver + :target: https://github.com/pypiserver/pypiserver/actions?query=workflow%3ATest .. |pypi-ver| image:: https://img.shields.io/pypi/v/pypiserver.svg :target: https://pypi.org/project/pypiserver/ diff --git a/requirements/dev.pip b/requirements/dev.pip index ed16fcf..38d8d13 100644 --- a/requirements/dev.pip +++ b/requirements/dev.pip @@ -4,17 +4,8 @@ # pip install -r requirements/dev.pip -r exe.pip +-r test.pip +black docopt # For `/bin/bumpver.py`. -gevent>=1.1b4; python_version >= '3' mypy; implementation_name == 'cpython' -pip>=7 -passlib>=1.6 -pytest>=2.3 -pytest-cov -setuptools -setuptools-git>=0.3 -tox -twine -webtest -wheel>=0.25.0 diff --git a/requirements/test.pip b/requirements/test.pip new file mode 100644 index 0000000..a92964c --- /dev/null +++ b/requirements/test.pip @@ -0,0 +1,13 @@ +# Just the absolutely necessary extra requirements for +# running tests + +gevent>=1.1b4; python_version >= '3' +pip>=7 +passlib>=1.6 +pytest>=2.3 +pytest-cov +setuptools +tox +twine +webtest +wheel>=0.25.0 diff --git a/tox.ini b/tox.ini index 61c2197..c096e79 100644 --- a/tox.ini +++ b/tox.ini @@ -2,26 +2,12 @@ envlist = py36, py37, py38, py39, pypy3 [testenv] -deps=-r{toxinidir}/requirements/dev.pip +deps=-r{toxinidir}/requirements/test.pip allowlist_externals= /bin/sh - mypy sitepackages=False - -[testenv:py{36,37,38,39}] commands= /bin/sh -c "{env:PYPISERVER_SETUP_CMD:true}" - # individual mypy files for now, until we get the rest - # of the project typechecking - mypy \ - pypiserver/config.py \ - tests/test_init.py - pytest --cov=pypiserver {posargs} - -[testenv:pypy3] -commands= - /bin/sh -c "{env:PYPISERVER_SETUP_CMD:true}" - # no mypy in pypy pytest --cov=pypiserver {posargs}