Skip to content

Commit

Permalink
Merge pull request #436 from PyCQA/use-poetry-for-packaging
Browse files Browse the repository at this point in the history
Use poetry for packaging
  • Loading branch information
carlio committed Aug 28, 2021
2 parents f9f6295 + 1c859c1 commit ee5b165
Show file tree
Hide file tree
Showing 10 changed files with 1,391 additions and 148 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI

on:
push:
branches:
- master
pull_request: ~
on: [push, pull_request]

env:
CACHE_VERSION: 3
Expand Down Expand Up @@ -49,9 +45,8 @@ jobs:
run: |
python -m venv venv
. venv/bin/activate
python -m pip install -U pip setuptools wheel
pip3 install coveralls coverage pre-commit pytest-cov pytest-benchmark
pip3 install -e ".["with_everything"]"
python -m pip install --disable-pip-version-check -U pip poetry
poetry install -E with_everything
- name: Generate pre-commit restore key
id: generate-pre-commit-key
run: >-
Expand Down Expand Up @@ -111,15 +106,16 @@ jobs:
- name: Run formatting check
run: |
. venv/bin/activate
pip install -e .
python -m pip install --disable-pip-version-check -U pip poetry
poetry install -E with_everything
pre-commit run --all-files
prepare-tests-linux:
name: Prepare tests for Python ${{ matrix.python-version }} (Linux)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev]
python-version: [3.6, 3.7, 3.8, 3.9]
outputs:
python-key: ${{ steps.generate-python-key.outputs.key }}
steps:
Expand Down Expand Up @@ -153,8 +149,8 @@ jobs:
run: |
python -m venv venv
. venv/bin/activate
python -m pip install -U pip setuptools wheel coveralls coverage pre-commit pytest-cov pytest-benchmark
pip3 install -e ".["with_everything"]"
python -m pip install --disable-pip-version-check -U pip poetry
poetry install -E with_everything
pytest-linux:
name: Run tests Python ${{ matrix.python-version }} (Linux)
Expand All @@ -163,7 +159,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v2.3.4
Expand All @@ -188,7 +184,8 @@ jobs:
- name: Run pytest
run: |
. venv/bin/activate
python -m pip install -U pip setuptools wheel coveralls coverage pre-commit pytest-cov pytest-benchmark
python -m pip install --disable-pip-version-check -U pip poetry
poetry install
pytest --benchmark-disable --cov --cov-report= tests/
Expand Down Expand Up @@ -224,8 +221,8 @@ jobs:
- name: Run nosetests
run: |
. venv/bin/activate
pip install safety pipenv numpy tzlocal nose coverage coveralls -U
pip freeze | safety check --stdin
python -m pip install --disable-pip-version-check -U pip poetry
poetry install
nosetests -s --with-coverage --cover-inclusive --cover-package=prospector tests/
mv .coverage .coverage.x
coverage run --parallel-mode prospector/run.py || true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: |
python -m pip install -U pip twine wheel
python -m pip install -U "setuptools>=56.0.0"
python -m pip install --disable-pip-version-check -U pip twine poetry
- name: Build distributions
run: |
python setup.py sdist bdist_wheel
poetry build -f wheel
poetry build -f sdist
- name: Upload to PyPI
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
env:
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ repos:
- id: codespell
args:
- --ignore-words-list=nin
- --skip=poetry.lock
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ handling the output of other tools. However, please do run them before submittin

nosetests tests/

Prospector targets Python 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8. You can use `tox`_ to test this locally,
Prospector targets Python 3.6, 3.7, 3.8 and 3.9. You can use `tox`_ to test this locally,
and all tests are run on `travis-ci.org`_.

.. _tox: https://tox.readthedocs.io/en/latest/
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Contributors
* Steven Myint ([@myint](https://github.com/myint))
* Sushobhit ([@sushobhit27](https://github.com/sushobhit27))
* Yaroslav Kurlaev ([@ykurlaev](https://github.com/ykurlaev))
* Pierre Sassoulas ([@Pierre-Sassoulas](https://github.com/Pierre-Sassoulas))
29 changes: 0 additions & 29 deletions Dockerfile

This file was deleted.

11 changes: 9 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ the output depending on the libraries your project uses.
Installation
------------

Prospector can be installed using ``pip`` by running the following command::
Prospector can be installed from PyPI using ``pip`` by running the following command::

pip install prospector


Optional dependencies for Prospector, such as ``pyroma`` can also be installed by running::

pip install prospector[with_pyroma]
Expand All @@ -56,6 +55,14 @@ Some shells (such as ``Zsh``, the default shell of macOS Catalina) require brack
For a list of all of the optional dependencies, see the optional extras section on the ReadTheDocs
page on `Supported Tools Extras <https://prospector.readthedocs.io/en/latest/supported_tools.html#optional-extras>`_.

For local development, [poetry](https://python-poetry.org/) is used. Check out the code, then run::

poetry install

And for extras::

poetry install -E with_everything

For more detailed information on installing the tool, see the
`installation section <http://prospector.readthedocs.io/en/latest/#installation>`_ of the tool's main page
on ReadTheDocs.
Expand Down
Loading

0 comments on commit ee5b165

Please sign in to comment.