Python style conventions¶
You can install these tools using:
$ pip install pre-commit $ pre-commit install # within the thapbi_pict main directory
The checks will then run automatically when you make a git commit. You can also run the checks directly using:
$ pre-commit run -a
If your editor can be configured to run flake8 and/or black automatically, even better. These checks are done as part of the continuous integration when changes are made on GitHub.
Currently this is setup to do automated testing under Linux on two free continuous integration services, CircleCI (using Conda for dependencies):
You can install all the dependencies using conda, or opt to install the
Python dependencies from PyPI with
explicitly or implicitly via
setup.py. Either should be fine.
The two requirements files (
requirements.txt for Python dependencies
requirements-ext.txt for external command line bioinformatics
tools) can contain exact pinned dependency versions, allowing us to
define a more reproducible environment for running this software if
Installing from source¶
First, download the code from GitHub and decompress it if required. The
best way to do this if you are likely to contribute any changes is at
the command line with
$ git clone https://github.com/peterjc/thapbi-pict.git $ cd thapbi-pict
Then load the plain text SQL dump of the default database into SQLite3,
database/README.rst for more information on this. Make it read
only to prevent accidental edits:
$ sqlite3 thapbi_pict/ITS1_DB.sqlite < database/ITS1_DB.sql $ chmod a-w thapbi_pict/ITS1_DB.sqlite
Assuming your default Python is at least version 3.5, to install the tool and automatically get our Python dependencies:
$ pip install .
If your system defaults to Python 2, try
pip3 install . or
python3 -m pip install . instead.
Once installed, you should be able to run the tool using:
This should automatically find the installed copy of the Python code.
thapbi_pict -v to report the version, or
thapbi_pict -h for
For a release, start from a clean git checkout (to reduce the chance of
bundling any stray local files despite a cautious
If the DB has changed, and this was not done locally, we must update it using the plain text dump which is under version control:
rm -rf thapbi_pict/ITS1_DB.sqlite sqlite3 thapbi_pict/ITS1_DB.sqlite < database/ITS1_DB.sql chmod a-w thapbi_pict/ITS1_DB.sqlite
If not, skip directly to:
rm -rf build/ python setup.py sdist --formats=gztar && python setup.py bdist_wheel git tag vX.Y.Z git push origin master --tags twine upload dist/thapbi_pict-X.Y.Z*
The PyPI upload should trigger an automated pull request updating the THAPBI PICT BioConda recipe which will need reviewing (e.g. new dependencies) before it is merged.
Must also turn the git tag into a “release” on GitHub, and attach the wheel to it. This will generate a version specific DOI on Zenodo. https://github.com/peterjc/thapbi-pict/releases