-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: setup.cfg, pyproject.toml, setuptools_scm
- Loading branch information
Showing
4 changed files
with
88 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
from .read import read_obo | ||
|
||
__version__ = "0.2.6" | ||
__all__ = [ | ||
"read_obo", | ||
] | ||
|
||
|
||
def _get_version(): | ||
# https://github.com/pypa/setuptools_scm#retrieving-package-version-at-runtime | ||
from pkg_resources import DistributionNotFound, get_distribution | ||
|
||
try: | ||
return get_distribution("obonet").version | ||
except DistributionNotFound: | ||
return None | ||
|
||
|
||
__version__ = _get_version() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
# including this section enables version inference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
[metadata] | ||
name = obonet | ||
author = Daniel Himmelstein | ||
author_email = daniel.himmelstein@gmail.com | ||
license = BSD-2-Clause-Patent | ||
license_file = LICENSE.md | ||
description = Parse OBO formatted ontologies into networkx | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown; charset=UTF-8 | ||
url = https://github.com/dhimmel/obonet | ||
project_urls = | ||
Source = https://github.com/dhimmel/obonet | ||
Tracker = https://github.com/dhimmel/obonet/issues | ||
classifiers = | ||
Intended Audience :: Science/Research | ||
License :: OSI Approved :: BSD License | ||
# "License :: OSI Approved :: BSD 2-Clause Plus Patent License (BSD-2-Clause-Patent)", | ||
# not a valid classifier. see https://github.com/pypa/trove-classifiers/issues/17 | ||
Operating System :: OS Independent | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Topic :: Scientific/Engineering :: Bio-Informatics | ||
Topic :: Scientific/Engineering :: Information Analysis | ||
keywords = | ||
obo | ||
ontology | ||
networkx | ||
parser | ||
network | ||
|
||
[options] | ||
packages = obonet | ||
zip_safe = False | ||
include_package_data = True | ||
python_requires = >=3 | ||
install_requires = | ||
networkx | ||
|
||
[options.extras_require] | ||
dev = | ||
pre-commit | ||
pytest | ||
|
||
[flake8] | ||
ignore = | ||
E203 | ||
E402 | ||
E501 | ||
E731 | ||
W503 | ||
|
||
[isort] | ||
profile = black | ||
multi_line_output = 3 | ||
include_trailing_comma = True | ||
force_grid_wrap = 0 | ||
use_parentheses = True | ||
line_length = 88 | ||
|
||
[mypy-networkx.*,setuptools.*,pytest.*,_pytest.*] | ||
ignore_missing_imports = True | ||
[mypy-*.tests.*] | ||
disallow_untyped_defs = False | ||
disallow_untyped_decorators = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,3 @@ | ||
import pathlib | ||
import re | ||
from setuptools import setup | ||
|
||
import setuptools | ||
|
||
directory = pathlib.Path(__file__).parent.absolute() | ||
|
||
# version | ||
init_path = directory.joinpath("obonet", "__init__.py") | ||
with init_path.open() as read_file: | ||
text = read_file.read() | ||
pattern = re.compile(r"^__version__ = ['\"]([^'\"]*)['\"]", re.MULTILINE) | ||
version = pattern.search(text).group(1) | ||
|
||
# long_description | ||
readme_path = directory.joinpath("README.md") | ||
with readme_path.open() as read_file: | ||
long_description = read_file.read() | ||
|
||
setuptools.setup( | ||
name="obonet", | ||
version=version, | ||
author="Daniel Himmelstein", | ||
author_email="daniel.himmelstein@gmail.com", | ||
url="https://github.com/dhimmel/obonet", | ||
project_urls={ | ||
"Source": "https://github.com/dhimmel/obonet", | ||
"Tracker": "https://github.com/dhimmel/obonet/issues", | ||
}, | ||
description="Parse OBO formatted ontologies into networkx", | ||
long_description_content_type="text/markdown", | ||
long_description=long_description, | ||
license="BSD-2-Clause-Patent", | ||
packages=["obonet"], | ||
keywords="obo ontology networkx parser network", | ||
classifiers=[ | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"Topic :: Scientific/Engineering :: Information Analysis", | ||
"License :: OSI Approved :: BSD License", | ||
# not a valid classifier. see https://github.com/pypa/trove-classifiers/issues/17 | ||
# "License :: OSI Approved :: BSD 2-Clause Plus Patent License (BSD-2-Clause-Patent)", | ||
"Programming Language :: Python :: 3", | ||
], | ||
# Dependencies | ||
python_requires=">=3", | ||
install_requires=[ | ||
"networkx", | ||
], | ||
) | ||
setup() |