Skip to content

Commit 5cc4f37

Browse files
committed
Transition from setup.py & friends to pyproject.toml
1 parent 7f5a674 commit 5cc4f37

File tree

14 files changed

+113
-2431
lines changed

14 files changed

+113
-2431
lines changed

.copier-answers.yml

Lines changed: 12 additions & 0 deletions
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: emperor
5+
plugin_name: q2_emperor
6+
plugin_scripts: null
7+
project_author_email: yoshiki@ucsd.edu
8+
project_author_name: Yoshiki Vazquez-Baeza
9+
project_description: Display ordination plots
10+
project_name: q2-emperor
11+
project_urls_homepage: https://qiime2.org
12+
project_urls_repository: https://github.com/qiime2/q2-emperor

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
q2_emperor/_version.py export-subst
1+
pyproject.toml export-subst

.github/workflows/ci-dev.yaml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@ target/
6767
# qiime
6868
*.qza
6969
*.qzv
70+
71+
# Version file from versioningit
72+
_version.py
73+

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test-cov: all
1515
py.test --cov=q2_emperor
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

Lines changed: 0 additions & 46 deletions
This file was deleted.

conda-recipe/meta.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package:
2+
name: q2-emperor
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+
- numpy
17+
- pandas {{ pandas }}
18+
- scikit-bio {{ scikit_bio }}
19+
- emperor ==1.0.4
20+
- qiime2 {{ qiime2_epoch }}.*
21+
- q2templates {{ qiime2_epoch }}.*
22+
- q2-types {{ qiime2_epoch }}.*
23+
build:
24+
- setuptools
25+
- versioningit
26+
test:
27+
requires:
28+
- qiime2 >={{ qiime2 }}
29+
- q2templates >={{ q2templates }}
30+
- q2-types >={{ q2_types }}
31+
- pytest
32+
imports:
33+
- q2_emperor
34+
- qiime2.plugins.emperor
35+
commands:
36+
- py.test --pyargs q2_emperor
37+
about:
38+
home: https://qiime2.org
39+
license: BSD-3-Clause
40+
license_family: BSD

pyproject.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[project]
2+
name = "q2-emperor"
3+
authors = [
4+
{ name = "Yoshiki Vazquez-Baeza", email = "yoshiki@ucsd.edu" }
5+
]
6+
description = "Display ordination plots"
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-emperor"
14+
15+
[project.entry-points.'qiime2.plugins']
16+
"q2-emperor" = "q2_emperor.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-emperor/_version.py"
41+
42+
[tool.setuptools]
43+
include-package-data = true
44+
45+
[tool.setuptools.packages.find]
46+
where = ["."]
47+
include = ["q2_emperor*"]
48+
49+
[tool.setuptools.package-data]
50+
q2_emperor = ["**/*"]

q2_emperor/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
# ----------------------------------------------------------------------------
88

99
from ._plot import plot, procrustes_plot, biplot, generic_plot
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
__all__ = ['plot', 'procrustes_plot', 'biplot', 'generic_plot']

0 commit comments

Comments
 (0)