Skip to content

Commit

Permalink
Move from setup.py to pyproject.toml (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjfleming authored Oct 31, 2023
1 parent 12b4758 commit be36006
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 86 deletions.
5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include README.rst
include LICENSE
include requirements.txt
include requirements-rtd.txt
include requirements-rtd.txt
include requirements-dev.txt
include cellbender/VERSION.txt
include cellbender/remove_background/report.ipynb
2 changes: 1 addition & 1 deletion build_docker_release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

tag=$(cat cellbender/__init__.py | sed -e 's?__version__ = ??' | sed "s/^'\(.*\)'$/\1/")
tag=$(cat cellbender/VERSION.txt)
release=v${tag}

docker build \
Expand Down
1 change: 1 addition & 0 deletions cellbender/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.0
4 changes: 3 additions & 1 deletion cellbender/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = '0.3.0'
from .base_cli import get_version

__version__ = get_version()
7 changes: 1 addition & 6 deletions cellbender/base_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ def read(rel_path):


def get_version() -> str:
for line in read('__init__.py').splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
return read('VERSION.txt').splitlines()[0]


class AbstractCLI(ABC):
Expand Down
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "cellbender"
authors = [{name = "Stephen Fleming"}, {name = "Mehrtash Babadi"}]
license = {text = "BSD (3-Clause)"}
description = "A software package for eliminating technical artifacts from high-throughput single-cell RNA sequencing (scRNA-seq) data"
keywords = ["scRNA-seq", "bioinformatics"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.7",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dynamic = ["version", "dependencies", "optional-dependencies"]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.urls]
Homepage = "http://github.com/broadinstitute/CellBender"
Documentation = "http://cellbender.readthedocs.io"

[project.scripts]
cellbender = "cellbender.base_cli:main"

[tool.setuptools]
zip-safe = false
include-package-data = true

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools.dynamic]
version = {attr = "cellbender.__version__"}
dependencies = {file = ["requirements.txt"]}
optional-dependencies.dev = {file = ["requirements-dev.txt"]}
optional-dependencies.docs = {file = ["requirements-rtd.txt"]}

[tool.setuptools.package-data]
"*" = ["cellbender.remove_background.report.ipynb", "cellbender.VERSION.txt"]
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest
scikit-learn
77 changes: 0 additions & 77 deletions setup.py

This file was deleted.

0 comments on commit be36006

Please sign in to comment.