Skip to content

Commit

Permalink
Convert setup.py to pyproject.toml (#56)
Browse files Browse the repository at this point in the history
* Convert setup.py to pyproject.toml

* Update CreateDistribution.txt to explain the 'build' module
  • Loading branch information
neilflood authored May 30, 2024
1 parent c593b98 commit 64a4207
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 47 deletions.
22 changes: 15 additions & 7 deletions CreateDistribution.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
How to create a distribution of pyshepseg.
How to create a distribution of pyshepseg. You will need the 'build' module
installed ("conda install build" or "pip install build").

1. Ensure that you have fetched and committed everything which needs to go in.
2. Change the version number in the pyshepseg/__init__.py. Version number
Expand All @@ -7,19 +8,26 @@ How to create a distribution of pyshepseg.
change logs since the last release, and noting what has been done.
DON'T FORGET TO COMMIT THIS, BEFORE THE NEXT STEP!!!!
4. Push the changes to github with "git push".

In practice, steps 2-3 are usually done as a single pull request, and
merged, rather than pushed directly, but I am skipping all the detail
of how to do a PR.
5. Check out a clean copy of the repository into /tmp or
somewhere similar and 'cd' into it.
6. Create the distribution tarball, using
python setup.py sdist --formats=zip
This creates a zip file, under a subdirectory called dist
7. Create a checksums this, e.g.
sha256sum pyshepseg-1.2.3.zip > pyshepseg-1.2.3.zip.sha256
6. Create the distribution tar.gz, using
python -m build .
This creates a tar.gz file, under a subdirectory called dist
e.g. pyshepseg-1.2.3.tar.gz
7. Create a checksum of this, e.g.
sha256sum pyshepseg-1.2.3.tar.gz > pyshepseg-1.2.3.tar.gz.sha256
8. Go to the https://github.com/ubarsc/pyshepseg/releases page, and create a
new release by pressing "Draft a new release".
You should fill in the following:
Tag version: pyshepseg-A.B.C
Release Title: Version A.B.C
Upload files: Add the zip file and the checksum.
Description: Add a brief description (a few lines at most) explaining
the key points about this release.
Upload files: Add the tar.gz file and the checksum.
Click "Publish release"


Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# The installation requires pip>=23.0. If not, it will fail in rather
# cryptic ways (depending exactly what options are used).
#

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pyshepseg"
dynamic = ["version"]
authors = [
{name = "Sam Gillingham"},
{name = "Neil Flood"}
]
description = "Python implementation of the image segmentation algorithm described by Shepherd et al"
readme = "README.md"
license = {file = "LICENSE.txt"}

dependencies = [
"numba",
"scikit-learn"
]

[project.scripts]
pyshepseg_run_seg = "pyshepseg.cmdline.run_seg:main"
pyshepseg_tiling = "pyshepseg.cmdline.tiling:main"
pyshepseg_subset = "pyshepseg.cmdline.subset:main"
pyshepseg_runtests = "pyshepseg.cmdline.runtests:main"
pyshepseg_variograms = "pyshepseg.cmdline.variograms:main"

[tool.setuptools]
packages = ["pyshepseg", "pyshepseg.cmdline"]

[tool.setuptools.dynamic]
version = {attr = "pyshepseg.__version__"}

[project.urls]
Repository = "https://github.com/ubarsc/pyshepseg.git"
Homepage = "https://www.pyshepseg.org"
40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

0 comments on commit 64a4207

Please sign in to comment.