Skip to content

Commit 1aa29f7

Browse files
q2d2lizgehret
andauthored
MAINT: transition setup.py to pyproject.toml (#107)
* Transition from setup.py & friends to pyproject.toml * fix setup.cfg --------- Co-authored-by: Liz Gehret <[email protected]>
1 parent 3a645f4 commit 1aa29f7

14 files changed

+120
-2513
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: assembly
5+
plugin_name: q2_assembly
6+
plugin_scripts: null
7+
project_author_email: [email protected]
8+
project_author_name: Michal Ziemski
9+
project_description: QIIME 2 plugin for (meta)genome assembly.
10+
project_name: q2-assembly
11+
project_urls_homepage: https://github.com/bokulich-lab/q2-assembly
12+
project_urls_repository: https://github.com/bokulich-lab/q2-assembly

.gitattributes

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

.github/workflows/ci-dev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml@dev
1111
with:
1212
distro: metagenome
13+
recipe-path: 'conda-recipe'
1314
additional-reports-path: ./coverage.xml
1415
additional-reports-name: coverage
1516

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@ test_megahit.py
144144
exported_*
145145
reads/*
146146
*.qza
147+
148+
# Version file from versioningit
149+
_version.py
150+

MANIFEST.in

-2
This file was deleted.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test-cov: all
1616
coverage xml
1717

1818
install: all
19-
$(PYTHON) setup.py install
19+
$(PYTHON) -m pip install -v .
2020

2121
dev: all
2222
pip install pre-commit

ci/recipe/meta.yaml

-51
This file was deleted.

conda-recipe/meta.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package:
2+
name: q2-assembly
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+
- quast
16+
- beautifulsoup4
17+
- biopython
18+
- bowtie2 {{ bowtie2 }}
19+
- gridss
20+
- insilicoseq
21+
- megahit ==1.2.9
22+
- pysam {{ pysam }}
23+
- qiime2 {{ qiime2_epoch }}.*
24+
- q2-types {{ qiime2_epoch }}.*
25+
- q2templates {{ qiime2_epoch }}.*
26+
- q2-demux {{ qiime2_epoch }}.*
27+
- samtools
28+
- shortuuid
29+
- spades ==3.15.2
30+
build:
31+
- setuptools
32+
- versioningit
33+
test:
34+
requires:
35+
- coverage
36+
- pytest
37+
- pytest-cov
38+
- parameterized
39+
imports:
40+
- q2_assembly
41+
- qiime2.plugins.assembly
42+
commands:
43+
- pytest --cov q2_assembly --cov-report xml:coverage.xml --pyargs q2_assembly
44+
about:
45+
home: https://github.com/bokulich-lab/q2-assembly
46+
license: BSD-3-Clause
47+
license_family: BSD

pyproject.toml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[project]
2+
name = "q2-assembly"
3+
authors = [
4+
{ name = "Michal Ziemski", email = "[email protected]" }
5+
]
6+
description = "QIIME 2 plugin for (meta)genome assembly."
7+
readme = {file = "README.md", content-type = "text/markdown"}
8+
license = {file = "LICENSE"}
9+
dynamic = ["version"]
10+
11+
[project.urls]
12+
Homepage = "https://github.com/bokulich-lab/q2-assembly"
13+
Repository = "https://github.com/bokulich-lab/q2-assembly"
14+
15+
[project.entry-points.'qiime2.plugins']
16+
"q2-assembly" = "q2_assembly.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-assembly/_version.py"
41+
42+
[tool.setuptools]
43+
include-package-data = true
44+
45+
[tool.setuptools.packages.find]
46+
where = ["."]
47+
include = ["q2_assembly*"]
48+
49+
[tool.setuptools.package-data]
50+
q2_assembly = ["**/*"]

q2_assembly/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# ----------------------------------------------------------------------------
88

9-
from ._version import get_versions
109
from .bowtie2 import indexing, mapping
1110
from .helpers import helpers
1211
from .iss import iss
1312
from .megahit import megahit
1413
from .quast import quast
1514
from .spades import spades
1615

17-
__version__ = get_versions()["version"]
18-
del get_versions
16+
try:
17+
from ._version import __version__
18+
except ModuleNotFoundError:
19+
__version__ = '0.0.0+notfound'
1920

2021
__all__ = ["indexing", "mapping", "iss", "megahit", "quast", "spades", "helpers"]

0 commit comments

Comments
 (0)