Skip to content

Commit b3c6ce1

Browse files
committed
Transition from setup.py & friends to pyproject.toml
1 parent 3d48251 commit b3c6ce1

File tree

14 files changed

+119
-2440
lines changed

14 files changed

+119
-2440
lines changed

.copier-answers.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: dfb0404
3+
_src_path: https://github.com/qiime2/q2-setup-template.git
4+
module_name: feature_classifier
5+
plugin_name: q2_feature_classifier
6+
plugin_scripts: null
7+
project_author_email: [email protected]
8+
project_author_name: Ben Kaehler
9+
project_description: Functionality for taxonomic classification
10+
project_name: q2-feature-classifier
11+
project_urls_homepage: https://qiime2.org
12+
project_urls_repository: https://github.com/qiime2/q2-feature-classifier

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
q2_feature_classifier/_version.py export-subst
1+
pyproject.toml export-subst

.github/workflows/ci-dev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ jobs:
1010
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml@dev
1111
with:
1212
distro: amplicon
13+
recipe-path: 'conda-recipe'

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ target/
6565
.*.swp
6666

6767
.DS_Store
68+
69+
# Version file from versioningit
70+
_version.py
71+

MANIFEST.in

-2
This file was deleted.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test-cov: all
1515
py.test --cov=q2_feature_classifier
1616

1717
install: all
18-
$(PYTHON) setup.py install
18+
$(PYTHON) -m pip install -v .
1919

2020
dev: all
2121
pip install -e .

ci/recipe/meta.yaml

-52
This file was deleted.

conda-recipe/meta.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package:
2+
name: q2-feature-classifier
3+
version: {{ PLUGIN_VERSION }}
4+
source:
5+
path: ..
6+
build:
7+
script: make install
8+
requirements:
9+
host:
10+
- python {{ python }}
11+
- setuptools
12+
- versioningit
13+
- wheel
14+
run:
15+
- python {{ python }}
16+
- scikit-learn {{ scikit_learn }}
17+
- joblib
18+
- scikit-bio {{ scikit_bio }}
19+
- biom-format {{ biom_format }}
20+
- blast >=2.13.0
21+
- vsearch
22+
- qiime2 {{ qiime2_epoch }}.*
23+
- q2-types {{ qiime2_epoch }}.*
24+
- q2-quality-control {{ qiime2_epoch }}.*
25+
- q2-taxa {{ qiime2_epoch }}.*
26+
- q2-feature-table {{ qiime2_epoch }}.*
27+
build:
28+
- setuptools
29+
- versioningit
30+
test:
31+
requires:
32+
- qiime2 >={{ qiime2 }}
33+
- q2-types >={{ q2_types }}
34+
- q2-quality-control >={{ q2_quality_control }}
35+
- q2-taxa >={{ q2_taxa }}
36+
- q2-feature-table >={{ q2_feature_table }}
37+
- pytest
38+
imports:
39+
- q2_feature_classifier
40+
- qiime2.plugins.feature_classifier
41+
commands:
42+
- py.test --pyargs q2_feature_classifier
43+
about:
44+
home: https://qiime2.org
45+
license: BSD-3-Clause
46+
license_family: BSD

pyproject.toml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[project]
2+
name = "q2-feature-classifier"
3+
authors = [
4+
{ name = "Ben Kaehler", email = "[email protected]" }
5+
]
6+
description = "Functionality for taxonomic classification"
7+
readme = {file = "README.md", content-type = "text/markdown"}
8+
license = {file = "LICENSE"}
9+
dynamic = ["version"]
10+
11+
[project.urls]
12+
Homepage = "https://qiime2.org"
13+
Repository = "https://github.com/qiime2/q2-feature-classifier"
14+
15+
[project.entry-points.'qiime2.plugins']
16+
"q2-feature-classifier" = "q2_feature_classifier.plugin_setup:plugin"
17+
18+
[build-system]
19+
requires = [
20+
"setuptools",
21+
"versioningit",
22+
"wheel"
23+
]
24+
build-backend = "setuptools.build_meta"
25+
26+
[tool.versioningit.vcs]
27+
method = "git-archive"
28+
describe-subst = "$Format:%(describe)$"
29+
default-tag = "0.0.1"
30+
31+
[tool.versioningit.next-version]
32+
method = "minor"
33+
34+
[tool.versioningit.format]
35+
distance = "{base_version}+{distance}.{vcs}{rev}"
36+
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
37+
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
38+
39+
[tool.versioningit.write]
40+
file = "q2-feature-classifier/_version.py"
41+
42+
[tool.setuptools]
43+
include-package-data = true
44+
45+
[tool.setuptools.packages.find]
46+
where = ["."]
47+
include = ["q2_feature_classifier*"]
48+
49+
[tool.setuptools.package-data]
50+
q2_feature_classifier = ["**/*"]

q2_feature_classifier/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
# ----------------------------------------------------------------------------
88

99
import importlib
10-
from ._version import get_versions
1110

12-
__version__ = get_versions()['version']
13-
del get_versions
11+
try:
12+
from ._version import __version__
13+
except ModuleNotFoundError:
14+
__version__ = '0.0.0+notfound'
1415

1516
importlib.import_module('q2_feature_classifier.types')
1617
importlib.import_module('q2_feature_classifier.classifier')

0 commit comments

Comments
 (0)