Skip to content

Commit

Permalink
Transition from setup.py & friends to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
q2d2 committed Dec 19, 2024
1 parent 228dc0f commit aa90ec3
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 2,435 deletions.
12 changes: 12 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: dfb0404
_src_path: https://github.com/qiime2/q2-setup-template.git
module_name: q2cli
plugin_name: q2cli
plugin_scripts: bin/tab-qiime
project_author_email: [email protected]
project_author_name: null
project_description: null
project_name: q2cli
project_urls_homepage: https://qiime2.org
project_urls_repository: https://github.com/qiime2/q2cli
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
q2cli/_version.py export-subst
pyproject.toml export-subst
1 change: 1 addition & 0 deletions .github/workflows/ci-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml@dev
with:
distro: amplicon
recipe-path: 'conda-recipe'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ runinfo

# vscode
.vscode/

# Version file from versioningit
_version.py

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mystery-stew: all
MYSTERY_STEW= pytest -k mystery_stew -n auto

install: all
$(PYTHON) setup.py install && \
$(PYTHON) -m pip install -v . && \
mkdir -p $(PREFIX)/etc/conda/activate.d && \
cp hooks/50_activate_q2cli_tab_completion.sh $(PREFIX)/etc/conda/activate.d/

Expand Down
44 changes: 0 additions & 44 deletions ci/recipe/meta.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package:
name: q2cli
version: {{ PLUGIN_VERSION }}
source:
path: ..
build:
script: make install
entry_points:
- qiime=q2cli.__main__:qiime
requirements:
host:
- python {{ python }}
- setuptools
- versioningit
- wheel
run:
- python {{ python }}
- setuptools
- click >=8.1
- qiime2 {{ qiime2_epoch }}.*
build:
- setuptools
- versioningit
test:
requires:
- qiime2 >={{ qiime2 }}
- pytest
- pytest-xdist
- q2-mystery-stew
imports:
- q2cli
commands:
- QIIMETEST= qiime --help
- QIIMETEST= py.test --pyargs q2cli
about:
home: https://qiime2.org
license: BSD-3-Clause
license_family: BSD
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[project]
name = "q2cli"
authors = [
{ name = "None", email = "[email protected]" }
]
description = "None"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
dynamic = ["version"]

[project.urls]
Homepage = "https://qiime2.org"
Repository = "https://github.com/qiime2/q2cli"

[project.entry-points.'qiime2.plugins']
"q2cli" = "q2cli.plugin_setup:plugin"

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

[tool.versioningit.vcs]
method = "git-archive"
describe-subst = "$Format:%(describe)$"
default-tag = "0.0.1"

[tool.versioningit.next-version]
method = "minor"

[tool.versioningit.format]
distance = "{base_version}+{distance}.{vcs}{rev}"
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"

[tool.versioningit.write]
file = "q2cli/_version.py"

[tool.setuptools]
include-package-data = true
script-files = [
"bin/tab-qiime"
]

[tool.setuptools.packages.find]
where = ["."]
include = ["q2cli*"]

[tool.setuptools.package-data]
q2cli = ["**/*"]
7 changes: 4 additions & 3 deletions q2cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------

from ._version import get_versions

__version__ = get_versions()['version']
del get_versions
try:
from ._version import __version__
except ModuleNotFoundError:
__version__ = '0.0.0+notfound'
Loading

0 comments on commit aa90ec3

Please sign in to comment.