-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Devops: adopt PEP 621 and move build spec to
pyproject.toml
Following PEP 621 it is now possible to fully define the build procedure of your package in `pyproject.toml`. Since this PEP is now well supported, and for example `pip` can use it, we migrate to it since it provides a bunch of benefits: * No longer need the deprecated `setup.py` to install the package. * Version number is now dynamically fetched from the package. * The `MANIFEST.in` is no longer necessary. The `flit` build tool will automatically include anything. The `pyproject.toml` has a tool section for `flit` that excludes the `tests` and `docs` folders. * Move configuration of pre-commit tools to `pyproject.toml`.
- Loading branch information
Showing
11 changed files
with
184 additions
and
172 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 |
---|---|---|
|
@@ -7,19 +7,25 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- uses: pre-commit/[email protected] | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install Python dependencies | ||
run: pip install -e .[pre-commit] | ||
|
||
- name: Run pre-commit | ||
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
python-version: ['3.7', '3.8', '3.9'] | ||
|
||
services: | ||
rabbitmq: | ||
|
@@ -28,25 +34,25 @@ jobs: | |
- 5672:5672 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install python dependencies | ||
run: pip install -e .[tests] | ||
- name: Install python dependencies | ||
run: pip install -e .[tests] | ||
|
||
- name: Run pytest | ||
run: pytest -sv --cov=plumpy test | ||
- name: Run pytest | ||
run: pytest -sv --cov=plumpy test | ||
|
||
- name: Create xml coverage | ||
run: coverage xml | ||
- name: Create xml coverage | ||
run: coverage xml | ||
|
||
- name: Upload coverage to Codecov | ||
if: github.repository == 'aiidateam/plumpy' | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
name: plumpy | ||
- name: Upload coverage to Codecov | ||
if: github.repository == 'aiidateam/plumpy' | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
name: plumpy |
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,61 +1,41 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
hooks: | ||
- id: double-quote-string-fixer | ||
- id: end-of-file-fixer | ||
- id: fix-encoding-pragma | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
hooks: | ||
- id: double-quote-string-fixer | ||
- id: end-of-file-fixer | ||
- id: fix-encoding-pragma | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/mgedmin/check-manifest | ||
rev: "0.44" | ||
hooks: | ||
- id: check-manifest | ||
- repo: https://github.com/pre-commit/mirrors-yapf | ||
rev: v0.32.0 | ||
hooks: | ||
- id: yapf | ||
name: yapf | ||
types: [python] | ||
args: ['-i'] | ||
additional_dependencies: ['toml'] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-yapf | ||
rev: v0.30.0 | ||
hooks: | ||
- id: yapf | ||
name: yapf | ||
types: [python] | ||
args: ["-i"] | ||
|
||
- repo: https://github.com/PyCQA/pylint | ||
rev: pylint-2.5.2 | ||
hooks: | ||
- id: pylint | ||
additional_dependencies: [ | ||
"pyyaml~=5.4", "nest_asyncio~=1.4.0", "aio-pika~=6.6", | ||
"aiocontextvars~=0.2.2; python_version<'3.7'", "kiwipy[rmq]~=0.7.4" | ||
] | ||
args: | ||
[ | ||
"--max-line-length=120", | ||
"--disable=import-outside-toplevel", | ||
"--disable=missing-docstring", | ||
"--disable=bad-continuation", | ||
"--disable=global-statement", | ||
"--disable=too-few-public-methods", | ||
"--disable=inconsistent-return-statements", | ||
"--disable=locally-disabled", | ||
"--disable=too-many-ancestors", | ||
"--disable=too-many-arguments", | ||
"--disable=too-many-instance-attributes", | ||
] | ||
exclude: > | ||
(?x)^( | ||
docs/source/conf.py| | ||
test/.*| | ||
)$ | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.790 | ||
hooks: | ||
- id: mypy | ||
args: [--config-file=tox.ini] | ||
additional_dependencies: ['aio_pika~=6.6'] | ||
files: > | ||
(?x)^( | ||
plumpy/.*py| | ||
)$ | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.790 | ||
hooks: | ||
- id: mypy | ||
args: [--config-file=tox.ini] | ||
additional_dependencies: ["aio_pika~=6.6"] | ||
files: > | ||
(?x)^( | ||
plumpy/.*py| | ||
)$ | ||
- repo: https://github.com/PyCQA/pylint | ||
rev: v2.12.2 | ||
hooks: | ||
- id: pylint | ||
language: system | ||
exclude: > | ||
(?x)^( | ||
docs/source/conf.py| | ||
test/.*| | ||
)$ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
[build-system] | ||
requires = ['flit_core >=3.4,<4'] | ||
build-backend = 'flit_core.buildapi' | ||
|
||
[project] | ||
name = 'plumpy' | ||
dynamic = ['version'] | ||
description = 'A Python workflow library.' | ||
authors = [ | ||
{name = 'Martin Uhrin', email = '[email protected]'}, | ||
{name = 'Sebastiaan Huber'}, | ||
{name = 'Jason Yu'}, | ||
{name = 'Leopold Talirz'}, | ||
{name = 'Dominik Gresch'}, | ||
] | ||
readme = 'README.md' | ||
license = {file = 'LICENSE'} | ||
classifiers = [ | ||
'Development Status :: 5 - Production/Stable', | ||
'License :: OSI Approved :: MIT License', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
] | ||
keywords = ['workflow', 'multithreaded', 'rabbitmq'] | ||
requires-python = '>=3.7' | ||
dependencies = [ | ||
'aio-pika~=6.6', | ||
'kiwipy[rmq]~=0.7.4', | ||
'nest_asyncio~=1.5', | ||
'pyyaml~=5.4', | ||
] | ||
|
||
[project.urls] | ||
Home = 'https://github.com/aiidateam/plumpy' | ||
Source = 'https://github.com/aiidateam/plumpy' | ||
Documentation = 'https://plumpy.readthedocs.io' | ||
|
||
[project.optional-dependencies] | ||
docs = [ | ||
'ipython~=7.0', | ||
'jinja2==2.11.3', | ||
'markupsafe==2.0.1', | ||
'myst-nb~=0.11.0', | ||
'sphinx~=3.2.0', | ||
'sphinx-book-theme~=0.0.39', | ||
] | ||
pre-commit = [ | ||
'mypy==0.790', | ||
'pre-commit~=2.2', | ||
'pylint==2.12.2', | ||
] | ||
tests = [ | ||
'ipykernel==6.12.1', | ||
'pytest==6.2.5', | ||
'pytest-asyncio==0.16.0', | ||
'pytest-cov==3.0.0', | ||
'pytest-notebook==0.7.0', | ||
'shortuuid==1.0.8', | ||
] | ||
|
||
[tool.flit.module] | ||
name = 'plumpy' | ||
|
||
[tool.flit.sdist] | ||
exclude = [ | ||
'docs/', | ||
'examples/', | ||
'test/', | ||
] | ||
|
||
[tool.pylint.format] | ||
max-line-length = 120 | ||
|
||
[tool.pylint.messages_control] | ||
disable = [ | ||
'bad-continuation', | ||
'consider-using-f-string', | ||
'duplicate-code', | ||
'global-statement', | ||
'import-outside-toplevel', | ||
'inconsistent-return-statements', | ||
'locally-disabled', | ||
'missing-docstring', | ||
'protected-access', | ||
'raise-missing-from', | ||
'too-few-public-methods', | ||
'too-many-ancestors', | ||
'too-many-arguments', | ||
'too-many-instance-attributes', | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = '6.0' | ||
testpaths = [ | ||
'test', | ||
] | ||
filterwarnings = [ | ||
'ignore::DeprecationWarning:frozendict:', | ||
] | ||
|
||
[tool.yapf] | ||
align_closing_bracket_with_visual_indent = true | ||
based_on_style = 'google' | ||
coalesce_brackets = true | ||
column_limit = 120 | ||
dedent_closing_brackets = true | ||
indent_dictionary_value = false | ||
split_arguments_when_comma_terminated = true |
Oops, something went wrong.