diff --git a/hsclient/__init__.py b/hsclient/__init__.py index 1f186a4..f0dfeaf 100644 --- a/hsclient/__init__.py +++ b/hsclient/__init__.py @@ -1,3 +1,6 @@ +# Version information +__version__ = "1.1.6" + from hsclient.hydroshare import ( Aggregation, File, diff --git a/hsclient/hydroshare.py b/hsclient/hydroshare.py index 59ef710..8dc5ba6 100644 --- a/hsclient/hydroshare.py +++ b/hsclient/hydroshare.py @@ -53,8 +53,7 @@ from hsclient.oauth2_model import Token from hsclient.utils import attribute_filter, encode_resource_url, is_aggregation, main_file_type -import pkg_resources # part of setuptools -VERSION = pkg_resources.get_distribution(__package__).version +from hsclient import __version__ as VERSION CHECK_TASK_PING_INTERVAL = 10 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cf3897a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,96 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "hsclient" +dynamic = ["version"] +description = "A python client for managing HydroShare resources" +readme = "README.md" +license = "MIT" +requires-python = ">=3.9" +authors = [ + {name = "Scott Black", email = "scott.black@usu.edu"}, +] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.14", +] +dependencies = [ + "hsmodels>=1.0.4", + "requests", + "requests_oauthlib", +] + +[project.urls] +Homepage = "https://github.com/hydroshare/hsclient" + +[project.optional-dependencies] +pandas = ["pandas"] +xarray = ["netCDF4", "xarray"] +rasterio = ["rasterio"] +fiona = ["fiona"] +all = ["pandas", "netCDF4", "xarray", "rasterio", "fiona"] +dev = [ + "pandas", "netCDF4", "xarray", "rasterio", "fiona", + "pytest", "pytest-xdist", "pytest-cov", + "mkdocs", "mknotebooks", "mkdocstrings", "mkdocstrings-python", +] + +[tool.setuptools] +packages = {find = {include = ["hsclient", "hsclient.*"], exclude = ["tests"]}} + +[tool.setuptools.dynamic] +version = {attr = "hsclient.__version__"} + +[tool.pytest.ini_options] +testpaths = ["tests"] + +[tool.flake8] +max-line-length = 120 +max-complexity = 14 +inline-quotes = "single" +multiline-quotes = "double" + +[tool.isort] +line_length = 120 +known_first_party = "hsclient" +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +combine_as_imports = true + +[tool.coverage.run] +source = ["hsclient"] +branch = true + +[tool.coverage.report] +precision = 2 + +[tool.mypy] +show_error_codes = true +follow_imports = "silent" +strict_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +disallow_any_generics = true +check_untyped_defs = true +no_implicit_reexport = true +warn_unused_configs = true +disallow_subclassing_any = true +disallow_incomplete_defs = true +disallow_untyped_decorators = true +disallow_untyped_calls = true +disallow_untyped_defs = true + +[[tool.mypy.overrides]] +module = "email_validator" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "dotenv" +ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 19ca9b7..0000000 --- a/setup.cfg +++ /dev/null @@ -1,51 +0,0 @@ -[tool:pytest] -testpaths = tests - -[flake8] -max-line-length = 120 -max-complexity = 14 -inline-quotes = single -multiline-quotes = double - -[coverage:run] -source = pydantic -branch = True - -[coverage:report] -precision = 2 - -[isort] -line_length=120 -known_first_party=hsclient -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -combine_as_imports=True - -[mypy] -show_error_codes = True -follow_imports = silent -strict_optional = True -warn_redundant_casts = True -warn_unused_ignores = True -disallow_any_generics = True -check_untyped_defs = True -no_implicit_reexport = True -warn_unused_configs = True -disallow_subclassing_any = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True -disallow_untyped_calls = True - -# for strict mypy: (this is the tricky one :-)) -disallow_untyped_defs = True - -# remaining arguments from `mypy --strict` which cause errors -;no_implicit_optional = True -;warn_return_any = True - -[mypy-email_validator] -ignore_missing_imports = true - -[mypy-dotenv] -ignore_missing_imports = true \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index a3868da..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -import pathlib -from setuptools import setup, find_packages - -README = (pathlib.Path(__file__).parent / "README.md").read_text() - -extra_deps = ["pandas", "netCDF4", "xarray", "rasterio", "fiona"] -dev_deps = ["pytest", "pytest-xdist", "pytest-cov", "mkdocs", "mknotebooks", "mkdocstrings", "mkdocstrings-python"] - -setup( - name='hsclient', - version='1.1.6', - packages=find_packages(include=['hsclient', 'hsclient.*'], - exclude=("tests",)), - install_requires=[ - 'hsmodels>=1.0.4', - 'requests', - 'requests_oauthlib', - 'setuptools', - ], - extras_require={ - "pandas": ["pandas"], - "xarray": ["netCDF4", "xarray"], - "rasterio": ["rasterio"], - "fiona": ["fiona"], - "all": extra_deps, - "dev": extra_deps + dev_deps, - }, - url='https://github.com/hydroshare/hsclient', - license='MIT', - author='Scott Black', - author_email='scott.black@usu.edu', - description='A python client for managing HydroShare resources', - python_requires='>=3.9', - long_description=README, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], -)