Skip to content

Commit

Permalink
Use poetry to manage the project
Browse files Browse the repository at this point in the history
- poetry manages all aspects of project
  metadata and dependencies in pyproject.toml
- Pipfile is obsolete
- setup.py is obsolete
  • Loading branch information
Darren Weber committed Jun 6, 2021
1 parent 2a7c7f5 commit 32bd40b
Show file tree
Hide file tree
Showing 7 changed files with 2,662 additions and 109 deletions.
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-yaml
args: [--unsafe]
exclude: '.*templates.*.yaml'
- id: end-of-file-fixer
exclude: 'CHANGELOG.md'
- id: trailing-whitespace
exclude: 'CHANGELOG.md'
- id: check-ast
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.9
hooks:
- id: shellcheck
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
12 changes: 7 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ Fist of all just clone repository::

$ git clone git@github.com:aio-libs/aiobotocore.git

Create virtualenv with at least python3.5 (older version are not supported).
Create virtualenv with at least python3.6 (older version are not supported).
For example using *virtualenvwrapper* commands could look like::

$ cd aiobotocore
$ mkvirtualenv --python=`which python3.5` aiobotocore
$ mkvirtualenv --python=`which python3.6` aiobotocore

After that please install libraries required for development. The
`make init` recipe will install [poetry](https://python-poetry.org/)
and then invoke a `poetry install` to install the required
dependencies for the library development.

After that please install libraries required for development::

$ pipenv sync --dev
$ make init

Congratulations, you are ready to run the test suite::

Expand Down
41 changes: 32 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

FLAGS=

flake: checkrst
pipenv run python3 -m flake8 --format=abspath
LIB=aiobotocore

init: poetry
@poetry install -v --no-interaction --extras boto3

flake: package-check
@poetry run python3 -m flake8 --format=abspath

test: flake
pipenv run python3 -Wd -m pytest -s -vv $(FLAGS) ./tests/
@poetry run python3 -Wd -m pytest -s -vv $(FLAGS) ./tests/

vtest:
pipenv run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -s -vv $(FLAGS) ./tests/

checkrst:
pipenv run python3 setup.py check -rms
@poetry run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -s -vv $(FLAGS) ./tests/

cov cover coverage: flake
pipenv run python3 -Wd -m pytest -s -vv --cov-report term --cov-report html --cov aiobotocore ./tests
@poetry run python3 -Wd -m pytest -s -vv --cov-report term --cov-report html --cov $(LIB) ./tests
@echo "open file://`pwd`/htmlcov/index.html"

# BOTO_CONFIG solves https://github.com/travis-ci/travis-ci/issues/7940
Expand All @@ -25,7 +27,6 @@ mototest:
BOTO_CONFIG=/dev/null pipenv run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m moto -n auto --cov-report term --cov-report html --cov=aiobotocore --cov=tests --log-cli-level=DEBUG aiobotocore tests
@echo "open file://`pwd`/htmlcov/index.html"


clean:
rm -rf `find . -name __pycache__`
rm -rf `find . -name .pytest_cache`
Expand All @@ -49,4 +50,26 @@ doc:
make -C docs html
@echo "open file://`pwd`/docs/_build/html/index.html"

typehint: clean
@poetry run mypy --follow-imports=skip $(LIB) tests

package: clean
@poetry check
@poetry build

package-check: package
@poetry run twine check dist/*

poetry:
@if ! command -v poetry > /dev/null; then \
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o /tmp/get-poetry.py; \
python /tmp/get-poetry.py; \
fi

poetry-export:
poetry export --without-hashes -f requirements.txt -o requirements.txt
sed -i -e 's/^-e //g' requirements.txt


.PHONY: init typehint package package-check poetry poetry-export
.PHONY: all flake test vtest cov clean doc
26 changes: 0 additions & 26 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 32bd40b

Please sign in to comment.