This PR adds the basic configuration that we'll use for development, along with basic layout of qbench package. The details are described below.
Package structure
The main package is called qbench. Setup files setup.cfg and pyproject.toml allow installation of the package in local environment and contain required metadata. The setup.py file allows installation in editable mode.
Note that some metadata (e.g. project description) contain only stubs/placeholders that will be replaced later on.
Package will be versioned using git tags (or GitHub releases). To do this, required configuration of setuptools_scm package is provided in pyproject.toml. To allow installation from zip archive, files .git_archival.txt and gitattributes are provided.
Tests
Tests are placed in tests package. For now, there is only a single dummy test (required for pytest not to fail on this PR).
Development tools
There are several development tools that we'll use with this repository, in particular:
black for code formatting. Black is configured to use 100 characters per line.
flake8 for style checking. To match line length configured for black, flake8 is also configured to use limit of 100 characters per line.
isort for import sorting. Note that isort has to be run with --profile=black, otherwise its output might be not compatible with black.
All code pushed to the repository should comply with the above tools. You can install all of them by installing package with dev dependencies.
Compliance with the above is checked for each pull request in a GitHub actions workflow. Workflows definition can be found in .github/workflows/quality_checks.yml
Optionally, you can check compliance with the above tools on each commit. To do so, install pre-commit package (pip install pre-commit) and run precommit install. Pre-commit hooks configuraiton is storedi n .pre-commit-config.yml.
How to test this PR
Clone the repository
Create fresh virtual environment
Install package in editable mode with dev and test optional requirements: pip install .[dev,test]
Test that qbench can be imported, e.g. by running python -c "import qbench"
Run pytest in current directory. All tests (well, the single test that's there) should pass without errors.
Check that you can run all the development tools.
To test that GitHub Actions workflows work, just look at this PR, it should contain the required checks.
This PR adds the basic configuration that we'll use for development, along with basic layout of
qbench
package. The details are described below.Package structure
The main package is called
qbench
. Setup filessetup.cfg
andpyproject.toml
allow installation of the package in local environment and contain required metadata. Thesetup.py
file allows installation in editable mode.Note that some metadata (e.g. project description) contain only stubs/placeholders that will be replaced later on.
Package will be versioned using git tags (or GitHub releases). To do this, required configuration of
setuptools_scm
package is provided inpyproject.toml
. To allow installation from zip archive, files.git_archival.txt
andgitattributes
are provided.Tests
Tests are placed in
tests
package. For now, there is only a single dummy test (required for pytest not to fail on this PR).Development tools
There are several development tools that we'll use with this repository, in particular:
--profile=black
, otherwise its output might be not compatible with black.All code pushed to the repository should comply with the above tools. You can install all of them by installing package with
dev
dependencies. Compliance with the above is checked for each pull request in a GitHub actions workflow. Workflows definition can be found in.github/workflows/quality_checks.yml
Optionally, you can check compliance with the above tools on each commit. To do so, install
pre-commit
package (pip install pre-commit)
and runprecommit install
. Pre-commit hooks configuraiton is storedi n.pre-commit-config.yml
.How to test this PR
dev
andtest
optional requirements:pip install .[dev,test]
qbench
can be imported, e.g. by runningpython -c "import qbench"
pytest
in current directory. All tests (well, the single test that's there) should pass without errors.To test that GitHub Actions workflows work, just look at this PR, it should contain the required checks.