Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Adds versioning to package #28

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions airtigrs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Top-level package for airtigrs"""

try:
from ._version import __version__
except ModuleNotFoundError:
from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_distribution("airtigrs").version
except DistributionNotFound:
__version__ = "unknown"
del get_distribution
del DistributionNotFound

__packagename__ = "airtigrs"
__url__ = "https://github.com/tigrlab/air-tigrs"

_all__ = [
"__packagename__",
"__version__",
]

DOWNLOAD_URL = (
f"https://github.com/tigrlab/{__packagename__}/archive/{__version__}.tar.gz"
)
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
"setuptools >= 48",
"setuptools_scm[toml] >= 4, < 6",
"setuptools_scm_git_archive",
"wheel",
]

build-backend = "setuptools.build_meta"

[tools.setuptools_scm]
write_to = "airtigrs/_version.py"
write_to_template = """\
\"\"\"Version file, automatically generated by setuptools_scm.\"\"\"

__version__ = "{version}"
"""
version_scheme = "no-guess-dev"
fallback_version = "unknown"
18 changes: 13 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,35 @@
name = airtigrs
description = Orchestration of TIGRLab dataflow infrastructure
long_description = file:README.md
long_description_content_type = text/markdown
keywords = neuroimaging, etl, automation, orchestration
classifiers =
Intended Audience :: Science/Research
Topic :: Scientific/Engineering
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
url = https://github.com/tigrlab/air-tigrs
project_urls =
GitHub = https://github.com/tigrlab/air-tigrs
Bug TRACKER = https://github.com/tigrlab/air-tigrs/issues
Bug Tracker = https://github.com/tigrlab/air-tigrs/issues
Documentation = https://imaging-genetics.camh.ca/air-tigrs
Source Code = https://github.com/tigrlab/air-tigrs

[options]
python_requires = >= 3.7
install_requires =
attrs
packaging
datman
datman >= 0.2.0
apache-airflow >= 2.1.4
apache-airflow-providers-sftp[ssh]

test_requires =
pytest
pytest_cov
pytest_mock
setup_requires =
setuptools_scm
toml
packages = find:
zip_safe = true

Expand All @@ -40,8 +48,8 @@ lint =
yapf >= 0.30.0
test =
pytest >= 6.2.4
pytest-mock
pytest-cov
pytest-mock
all =
%(doc)s
%(lint)s
Expand Down
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from setuptools import setup

import setuptools

if __name__ == '__main__':
setuptools.setup()
if __name__ == "__main__":
setup()