Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use poetry for dependency management #51

Merged
merged 27 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8e9bf88
Add config files for using poetry
bjoernricks Mar 30, 2020
7bdc28b
Use poetry mode for the git hooks
bjoernricks Mar 30, 2020
b0ab2b9
Update README for poetry usage
bjoernricks Mar 30, 2020
ab61c48
Add config class for the poetry settings
bjoernricks Mar 30, 2020
abcdbfb
Update get_version function for poetry
bjoernricks Mar 30, 2020
9f2c594
Raise an error if setup.py is run with Python 2
bjoernricks Mar 30, 2020
fcb1b8c
Update setup.py to read most settings from pyproject.toml
bjoernricks Mar 30, 2020
9f9c597
Update RELASE documentation to use poetry
bjoernricks Mar 30, 2020
4a8abbe
Remove Pipfile and Pipfile.lock
bjoernricks Apr 2, 2020
0e17a55
Let poetry find the namespace packages
bjoernricks Apr 2, 2020
05288bb
Use a constant version in autohooks package
bjoernricks Apr 2, 2020
9f7f574
Replace pipenv with poetry in CicleCI config
bjoernricks Apr 3, 2020
03481cf
Ensure pypirc gets created always on CircleCI
bjoernricks Apr 3, 2020
22a8160
Start to add functions for handling the version of autohooks
bjoernricks Apr 3, 2020
7e14212
Replace using toml with tomlkit
bjoernricks Apr 3, 2020
f08523b
Don't depend on setuptools for checking the version
bjoernricks Apr 3, 2020
27a515f
Add tools for version handling in autohooks
bjoernricks Apr 6, 2020
e2bd0b5
Update RELEASE docs for new version process
bjoernricks Apr 6, 2020
041ece6
Add linting of version info to CircleCI config
bjoernricks Apr 6, 2020
70ff369
We depend on setuptools for the moment
bjoernricks Apr 6, 2020
4f6fe8d
Add CHANGELOG entry for new version handling
bjoernricks Apr 6, 2020
718d2ea
Ensure an up to date pip version on the ci image
bjoernricks Apr 6, 2020
81a64f0
Update dependencies in setup.py
bjoernricks Apr 6, 2020
5a2bc6e
Replace toml usage with tomlkit in hooks module
bjoernricks Apr 6, 2020
517bf9f
Update pip within the environment
bjoernricks Apr 6, 2020
7353866
Add CHANGELOG entry for using poetry
bjoernricks Apr 6, 2020
3297113
Update CHANGELOG.md
bjoernricks Apr 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
69 changes: 37 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@ executors:
python-35:
docker:
- image: circleci/python:3.5
environment:
PIPENV_VENV_IN_PROJECT: true
working_directory: ~/repo
python-36:
docker:
- image: circleci/python:3.6
environment:
PIPENV_VENV_IN_PROJECT: true
working_directory: ~/repo
python-37:
docker:
- image: circleci/python:3.7
environment:
PIPENV_VENV_IN_PROJECT: true
working_directory: ~/repo
python-38:
docker:
- image: circleci/python:3.8
environment:
PIPENV_VENV_IN_PROJECT: true
working_directory: ~/repo

commands:
Expand All @@ -32,72 +24,85 @@ commands:
steps:
- checkout
- run:
name: Install dependencies
command: |
pipenv install
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
- run:
name: Install autohooks
command: |
pipenv run pip install .
name: Install dependencies
command: poetry install --no-dev
test:
description: "Download and run tests"
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
- run:
name: Install dependencies
command: pipenv install
command: poetry install --no-dev
- run:
name: Run unit tests
command: |
pipenv run python -m unittest
command: poetry run python -m unittest
test-with-codecov:
description: "Download and run tests"
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
- run:
name: Install dependencies
command: pipenv install
command: poetry install --no-dev
- run:
name: Install codecov
command: |
pipenv run pip install codecov
command: poetry run pip install codecov
- run:
name: Run unit tests
command: |
pipenv run coverage run -m unittest
command: poetry run coverage run -m unittest
- run:
name: Upload coverage to Codecov
command: pipenv run codecov
command: poetry run codecov
lint:
description: "Lint python files"
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
- run:
name: Install dependencies
command: pipenv install --dev
command: poetry install
- run:
name: Print possible diff generated with black
command: pipenv run black -q --diff autohooks tests
command: poetry run black -q --diff autohooks tests
- run:
name: Check with black
command: pipenv run black --check autohooks tests
command: poetry run black --check autohooks tests
- run:
name: Check with pylint
command: pipenv run pylint --disable=R autohooks tests
command: poetry run pylint --disable=R autohooks tests
- run:
name: Check version information
command: poetry run python -m autohooks.version verify current
deploy:
description: "Upload package to PyPI"
steps:
- checkout
- run:
name: Create environment, update pip and setuptools
command: poetry run pip install -U pip setuptools
- run:
name: Install dependencies
command: pipenv install
command: poetry install --no-dev
- run:
name: Verify tag version
command: poetry run python -m autohooks.version verify ${CIRCLE_TAG}
- run:
name: Install twine
command: pipenv run pip install twine
command: poetry run pip install twine
- run:
name: Initialize .pypirc
command: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "[distutils]" > ~/.pypirc
echo -e "index-servers = pypi" >> ~/.pypirc
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = __token__" >> ~/.pypirc
Expand All @@ -106,8 +111,8 @@ commands:
name: Create and upload distribution to pypi
command: |
rm -rf dist build python_gvm.egg-info
pipenv run setup.py sdist
pipenv run twine upload dist/*
poetry build --format sdist
poetry run twine upload dist/*

jobs:
build-35:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added

* Added tools for version handling in autohooks [#51](https://github.com/greenbone/autohooks/pull/51)

### Changed

* Reworked `Terminal` class from `terminal.py` [#45](https://github.com/greenbone/autohooks/pull/45)
* Replaced pipenv with poetry for dependency management. `poetry install` works a
bit different than `pipenv install`. It installs dev packages and also autohooks
in editable mode by default. [#51](https://github.com/greenbone/autohooks/pull/51)

### Fixed

Expand Down
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.