-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] Updates Python version, migrates to poetry (#14)
- Loading branch information
Showing
10 changed files
with
876 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,192 +1,39 @@ | ||
version: 2.1 | ||
|
||
commands: | ||
|
||
bumpversion: | ||
description: "Uses bump2version to increase version number" | ||
parameters: | ||
version_part: | ||
type: enum | ||
enum: ['major', 'minor', 'patch', 'pre_release', 'pre_release_num'] | ||
bump_options: | ||
type: string | ||
default: '--no-tag --commit -m "Bump version: {current_version} → {new_version} [ci skip]"' | ||
steps: | ||
- restore_cache: | ||
key: v1-bumpversion | ||
- run: | ||
name: Install/Upgrade bumpversion | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip3 install -U bump2version | ||
- save_cache: | ||
key: v1-bumpversion | ||
paths: | ||
- "venv" | ||
- run: | ||
name: Bumpversion | ||
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Git Robot" | ||
. venv/bin/activate | ||
python3 setup.py --version | ||
bumpversion << parameters.bump_options >> << parameters.version_part >> | ||
python3 setup.py --version | ||
git log -n 1 | ||
- run: | ||
name: Push version bump | ||
command: | | ||
git push -u origin $CIRCLE_BRANCH | ||
publish: | ||
description: "Uses twine to publish packages to PyPI" | ||
parameters: | ||
verify_tag: | ||
type: boolean | ||
default: false | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-release-{{ .Branch }}-{{ checksum "requirements.txt" }} | ||
- v1-dependency-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}-py37 | ||
- run: | ||
name: Install/Upgrade release requirements | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip3 install -U -r requirements.txt | ||
pip3 install -U wheel | ||
pip3 install -U twine | ||
- save_cache: | ||
key: v1-release-{{ .Branch }}-{{ checksum "requirements.txt" }} | ||
paths: | ||
- "venv" | ||
- when: | ||
condition: << parameters.verify_tag >> | ||
steps: | ||
- run: | ||
name: Verify git tag vs. package version | ||
command: | | ||
. venv/bin/activate | ||
python setup.py verify | ||
- run: | ||
name: Publish to PyPI | ||
command: | | ||
. venv/bin/activate | ||
python3 setup.py sdist | ||
python3 setup.py bdist_wheel | ||
twine upload dist/* | ||
orbs: | ||
python: circleci/[email protected] | ||
|
||
jobs: | ||
|
||
install_deps_py37: | ||
unittest_py38: | ||
docker: | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: v1-dependency-cache-{{ .Branch }}-{{ checksum "requirements.txt" }} | ||
- run: | ||
name: Install package dependencies | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip3 install -U -r requirements.txt | ||
- save_cache: | ||
key: v1-dependency-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}-py37 | ||
paths: | ||
- "venv" | ||
|
||
unittest_py37: | ||
docker: | ||
- image: circleci/python:3.7 | ||
- image: cimg/python:3.8 | ||
environment: | ||
PYTEST_ADDOPTS: --cov-report=xml:test-reports/coverage.xml --junitxml=test-reports/junit.xml | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: v1-dependency-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}-py37 | ||
key: v1-dependency-cache-{{ .Branch }}-{{ checksum "poetry.lock" }}-py38 | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
- run: | ||
name: Fix arango-orm dependencies | ||
command: | | ||
poetry run pip install six | ||
- run: | ||
name: Run tests | ||
command: | | ||
. venv/bin/activate | ||
python3 setup.py test | ||
poetry run pytest -vv --cov=flask_arango_orm tests/ | ||
- save_cache: | ||
key: v1-dependency-cache-{{ .Branch }}-{{ checksum "poetry.lock" }}-py38 | ||
paths: | ||
- "~/.cache/pypoetry" | ||
- store_test_results: | ||
path: test-reports | ||
- store_artifacts: | ||
path: test-reports | ||
- run: | ||
name: Smoke Test Install | ||
command: | | ||
. venv/bin/activate | ||
python3 --version | ||
python3 setup.py install | ||
bump_publish_dev: | ||
docker: | ||
- image: circleci/python:3.7 | ||
environment: | ||
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ | ||
steps: | ||
- checkout | ||
- publish | ||
- bumpversion: | ||
version_part: pre_release_num | ||
|
||
bump_publish_release: | ||
docker: | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- publish | ||
- bumpversion: | ||
version_part: pre_release_num | ||
|
||
publish_prod_tag: | ||
docker: | ||
- image: circleci/python:3.7 | ||
steps: | ||
- checkout | ||
- publish: | ||
verify_tag: true | ||
|
||
workflows: | ||
version: 2 | ||
|
||
build_test_publish_py37: | ||
build_test_publish_py38: | ||
jobs: | ||
- install_deps_py37: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- unittest_py37: | ||
requires: | ||
- install_deps_py37 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- bump_publish_dev: | ||
context: Test PyPI | ||
requires: | ||
- unittest_py37 | ||
filters: | ||
branches: | ||
only: develop | ||
- bump_publish_release: | ||
context: Prod PyPI | ||
requires: | ||
- unittest_py37 | ||
filters: | ||
branches: | ||
only: /^release\/.*/ | ||
- publish_prod_tag: | ||
context: Prod PyPI | ||
requires: | ||
- unittest_py37 | ||
filters: | ||
tags: | ||
only: /^v[0-9]+(\.[0-9]+)+$/ | ||
branches: | ||
ignore: /.*/ | ||
- unittest_py38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.