Build Biopython with many small steps!!
The instructions below require that you have access to a few servers and the code repository. When you start, be sure to have write access to:
If you don’t have any of the above, please ask.
We assume you have cloned these under ~/repositories/
and that the
git origin
is the official Biopython copy of the repository.
We assume you are running Linux (but macOS should be fine too), and have the following tools installed (plus as many of the Biopython optional dependencies as possible for local testing):
pip install twine
Using git make sure I have the latest code:
$ cd ~/repositories/biopython
$ git checkout master
$ git pull origin master
make sure the README.rst
file is still up to date
add any important info to NEWS.rst
or DEPRECATED.rst
- you can get a
log of recent git changes like this (adjust the date accordingly):
$ git log --since="2020/05/25" --reverse --pretty="medium"
make sure CONTRIB.rst
still current
make sure setup.py
and MANIFEST.in
are still up to date
bump version numbers and set the release data:
Bio/__init__.py
NEWS.rst
- fill in the release date$ git commit Bio/__init__.py NEWS.rst -m "Call this Biopython 1.78"
do a final check to make sure things are checked in:
$ rm -r build
$ rm Tests/*.pyc
$ make clean -C Doc
$ git status
build Biopython and run a final regression test:
drevil:~biopython> python setup.py build
drevil:~biopython> python setup.py test
Running the tests simultaneously (e.g. with different versions of Python) is risky as two threads may both try to read/write to the same temp files.
Push this to gitub, all being well this commit will be tagged as the release (barring no problems uncovered while building the documentation, or with the manifest while testing the tar-ball):
$ git push origin master
check out a clean version somewhere else:
drevil:~tmp1/> git clone https://github.com/biopython/biopython.git
drevil:~tmp1/> cd biopython
make the documentation PDF in Doc (we have automated an HTML version online; will need latexmk
etc installed):
drevil:~tmp1/biopython/> pip install -r .circleci/requirements-sphinx.txt
drevil:~tmp1/biopython/> make -C Doc latexpdf
drevil:~tmp1/biopython/> cp Doc/_build/latex/Biopython_doc.pdf Doc/
drevil:~tmp1/biopython/> make clean -C Doc
make the source distribution
drevil:~tmp1/biopython> python setup.py sdist --formats=gztar,zip
untar the file somewhere else
drevil:~tmp1/biopython/> cd ..
drevil:~tmp1/> tar -xzvf biopython/dist/biopython-1.78.tar.gz
drevil:~tmp1/> cd biopython-1.78
Check to make sure it includes the documentation PDF file under Doc
make sure I can build (won’t install and use this) and test it (using the tar-ball test files):
drevil:~tmp1/biopython-1.78/> python -m pip install . --prefix /tmp/test-install
drevil:~tmp1/biopython-1.78/> cd Tests && python run_tests.py
A typical source of failure here (on the tests) is the lack of example
files being added to the source distribution: add them to MANIFEST.in
Since Biopython 1.74, Sphinx has handled the API documentation via continuous integration, but you still have to update the “latest” symlink.
$ cd ~/repositories/docs/
$ git fetch origin
$ git checkout gh-pages # should only be this one branch
$ git rebase origin/gh-pages # get any changes
$ rm latest
$ ln -s 1.78 latest
$ git commit latest -m "Update 'latest' symlink to point at 1.78"
$ git push origin gh-pages
Update Tutorial and PDB FAQ on the website manually.
$ cd ~/repositories/DIST/docs/tutorial/
$ git fetch origin
$ git checkout gh-pages # should only be this one branch
$ git rebase origin/gh-pages # get any changes
$ cp ../../../biopython/Doc/biopdb_faq.pdf .
$ cp ../../../biopython/Doc/Tutorial.html Tutorial-1.80.html
$ cp ../../../biopython/Doc/Tutorial.pdf Tutorial-1.80.pdf
$ rm Tutorial.html Tutorial.pdf
$ ln -s Tutorial-1.80.html Tutorial.html
$ ln -s Tutorial-1.80.pdf Tutorial.pdf
$ git add Tutorial-1.80.html Tutorial-1.80.pdf
$ git commit Tutorial-1.80.html Tutorial-1.80.pdf Tutorial.html Tutorial.pdf biopdb_faq.pdf -m "Tutorial and FAQ for Biopython 1.80"
$ git push origin gh-pages
Now we use https://github.com/biopython/biopython-wheels to build wheels,
by updating the git checkout
line in .github/workflows/cibuildwheel.yml
to the new release’s commit hash (which all being well will get a git tag).
$ cd ~/repositories
$ git clone git@github.com:biopython/biopython-wheels.git
$ cd biopython-wheels/
$ git submodule update --init
$ emacs .github/workflows/cibuildwheel.yml # update git checkout line
$ git commit .github/workflows/cibuildwheel.yml -m "Build Biopython 1.xx"
$ git push origin master
Check the wheels build on the GitHub Actions runs.
You don’t seem to need to update the biopython
git submodule, but if you
need to this seems to work.
$ git submodule foreach git pull origin master
$ git commit -a -m "Update submodules"
$ git push origin master
Successful wheels will in an artifact.zip
file available in the footer of the
run via GitHub Actions runs.
Download this and unzip to your ~/repository/biopython/DIST/
folder.
We will upload these to PyPI later using Twine.
If you have a Windows machine, remove any prior Biopython installations, and confirm the Windows wheel file(s) work.
Back in the main repository, tag the release:
$ cd .../tmp1/biopython/
$ git tag biopython-178
$ git push origin master --tags
Upload the new release tar-ball and zip to the website via GitHub Pages DIST
repository.
$ cp dist/biopython-1.78.* ~/repositories/DIST/
$ cd ~/repositories/DIST/
$ git add biopython-1.78.*
$ git commit biopython-1.78.* -m "Downloads for Biopython 1.78"
$ shasum -a 256 biopython-1.78.*
$ md5sum biopython-1.78.*
$ git commit --amend # paste checksums into comment
$ git push origin gh-pages
Upload to the python package index (except for beta/alpha level releases):
$ cd ~/repositories/biopython/
$ pip install twine
$ twine upload dist/biopython-1.78.tar.gz
$ twine upload dist/biopython-1.78-*.whl
You need to have a login on pypi and be registered with Biopython to be able to upload the new version
Check this is live at https://pypi.python.org/pypi/biopython/
Update the website:
biopython.github.io
repository,
(otherwise make sure your copy is up to date):$ cd ~/repositories
$ git clone git@github.com:biopython/biopython.github.io.git
$ cd ~/repositories/biopython.github.io
$ emacs _config.yml
$ emacs wiki/Biopython.md
$ emacs wiki/Download.md
$ git commit _config.yml wiki/Biopython.md wiki/Download.md -m "Biopython 1.78 released"
Announcement:
Conda-Forge should automatically open a pull request to update the package once it appears on PyPI. Check for a new pull request on github.com/conda-forge/biopython-feedstock which once merged will upload the new release to anaconda.org/conda-forge/biopython
Bump version numbers again
Bio/__init__.py
versionNEWS.rst
for next versionInclude the suffix .dev0
to indicate this is a development version
e.g. if you had __version__ = "1.78"
, make it 1.79.dev0