Skip to content

Commit d15baee

Browse files
committed
Updated packaging
1 parent ac0942d commit d15baee

File tree

5 files changed

+67
-54
lines changed

5 files changed

+67
-54
lines changed

dask_groupby/__init__.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env python
22
# flake8: noqa
33
"""Top-level module for dask_groupby ."""
4-
from pkg_resources import DistributionNotFound, get_distribution
5-
64
from .core import groupby_reduce # noqa
75

86
try:
9-
__version__ = get_distribution(__name__).version
10-
except DistributionNotFound:
11-
# package is not installed
12-
_version__ = "unknown"
7+
from importlib.metadata import version as _version
8+
except ImportError:
9+
# if the fallback library is missing, we are doomed.
10+
from importlib_metadata import version as _version # type: ignore[no-redef]
11+
12+
try:
13+
__version__ = _version("dask_groupby")
14+
except Exception:
15+
# Local copy or not installed with setuptools.
16+
# Disable minimum version checks on downstream libraries.
17+
__version__ = "999"

pyproject.toml

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"setuptools_scm[toml]>=3.4",
6+
"setuptools_scm_git_archive",
7+
]
8+
build-backend = "setuptools.build_meta"
9+
10+
[tool.setuptools_scm]
11+
fallback_version = "999"
12+
113
[tool.black]
214
line-length = 100
315
target-version = ["py38"]

requirements.txt

-4
This file was deleted.

setup.cfg

+42-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
[metadata]
2+
name = dask_groupby
3+
author = dask_groupby Developers
4+
author_email = [email protected]
5+
license = Apache
6+
description = GroupBy operations for dask.array
7+
long_description_content_type=text/x-rst
8+
long_description =
9+
Map-reduce style groupby operations for dask.array
10+
11+
url = https://github.com/dcherian/dask_groupby
12+
classifiers =
13+
Development Status :: 4 - Beta
14+
License :: OSI Approved :: Apache Software License
15+
Operating System :: OS Independent
16+
Intended Audience :: Science/Research
17+
Programming Language :: Python
18+
Programming Language :: Python :: 3
19+
Programming Language :: Python :: 3.7
20+
Programming Language :: Python :: 3.8
21+
Programming Language :: Python :: 3.9
22+
Programming Language :: Python :: 3.10
23+
Topic :: Scientific/Engineering
24+
25+
[options]
26+
zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.html
27+
include_package_data = True
28+
python_requires = >=3.7
29+
install_requires =
30+
dask
31+
numpy_groupies
32+
toolz
33+
xarray
34+
importlib-metadata; python_version < '3.8'
35+
typing_extensions >= 3.7; python_version < '3.8'
36+
37+
[options.extras_require]
38+
test =
39+
netCDF4
40+
141
[flake8]
242
ignore =
343
# whitespace before ':' - doesn't work well with black
@@ -11,9 +51,8 @@ ignore =
1151
W503
1252
# too complex
1353
C901
54+
per-file-ignores =
55+
xarray/tests/*.py:F401,F811
1456
exclude=
1557
.eggs
1658
doc
17-
max-line-length = 100
18-
max-complexity = 18
19-
select = B,C,E,F,W,T4,B9

setup.py

+2-41
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,5 @@
11
#!/usr/bin/env python
22

3-
"""The setup script."""
3+
from setuptools import setup
44

5-
from setuptools import find_packages, setup
6-
7-
with open("requirements.txt") as f:
8-
requirements = f.read().strip().split("\n")
9-
10-
with open("README.md") as f:
11-
long_description = f.read()
12-
13-
setup(
14-
maintainer="Deepak Cherian",
15-
maintainer_email="[email protected]",
16-
python_requires=">=3.6",
17-
classifiers=[
18-
"Development Status :: 2 - Pre-Alpha",
19-
"License :: OSI Approved :: Apache Software License",
20-
"Natural Language :: English",
21-
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.6",
23-
"Programming Language :: Python :: 3.7",
24-
"Programming Language :: Python :: 3.8",
25-
"Topic :: Scientific/Engineering",
26-
"Operating System :: OS Independent",
27-
"Intended Audience :: Science/Research",
28-
],
29-
description="GroupBy operations for dask.array",
30-
install_requires=requirements,
31-
license="Apache Software License 2.0",
32-
long_description=long_description,
33-
include_package_data=True,
34-
keywords="dask_groupby",
35-
name="dask_groupby",
36-
packages=find_packages(include=["dask_groupby", "dask_groupby.*"]),
37-
url="https://github.com/dcherian/dask_groupby",
38-
project_urls={
39-
"Documentation": "https://github.com/dcherian/dask_groupby",
40-
"Source": "https://github.com/dcherian/dask_groupby",
41-
"Tracker": "https://github.com/dcherian/dask_groupby/issues",
42-
},
43-
zip_safe=False,
44-
)
5+
setup(use_scm_verion=True)

0 commit comments

Comments
 (0)