diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f6326c..f1bc0a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: run: | python3 -m pip install --upgrade pip setuptools wheel make clean - python3 -m pip install . + python3 -m pip install ".[dev]" - name: Install Validation run: | python -c "import snowexsql" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 16de730..668c11b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,7 @@ jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: [3.8, 3.9, '3.10'] @@ -46,7 +47,7 @@ jobs: sudo apt-get install -y postgis gdal-bin python3 -m pip install --upgrade pip python3 -m pip install pytest coverage - if [ -f requirements_dev.txt ]; then python3 -m pip install -r requirements_dev.txt; fi + python3 -m pip install -e ".[dev]" - name: Test with pytest run: | pytest -s diff --git a/.gitignore b/.gitignore index 308b7ce..a620e86 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,7 @@ htmlcov/* scripts/upload/test*.txt .idea/ scripts/download/data/* +*.egg-info + +# Version +_version.py diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1a01506..82429fd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -26,7 +26,7 @@ formats: [] # Optionally set the version of Python and requirements required to build your docs python: install: - - requirements: docs/requirements.txt - - requirements: requirements.txt - - method: setuptools + - method: pip path: . + extra_requirements: + - docs diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..346bd19 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,70 @@ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "snowexsql" +dynamic = ["version"] +description = "SQL Database software for SnowEx data" +keywords = ["snowex", "sql", "database", "snow"] +readme = "README.rst" +requires-python = ">=3.8" +classifiers = [ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10' +] +dependencies = [ + "utm>=0.5.0,<1.0", + "geoalchemy2>=0.6,<1.0", + "geopandas>=0.7,<2.0", + "psycopg2-binary>=2.9.0,<2.10.0", + "rasterio>=1.1.5", + "SQLAlchemy >= 2.0.0", +] + +[project.optional-dependencies] +dev = [ + "pip==23.3", + "coverage==5.5", + "pytest==6.2.4", + "pytest-cov==2.12.1", + "sphinx-autobuild<=2024.5", +] +docs = [ + "ipython>7.0,<9.0", + "nbconvert>=6.4.3,<6.5.0", + "nbsphinx==0.9.4", + "pandoc==1.0.2", + "plotly==5.22.0", + "sphinx-gallery==0.9.0", + "sphinx>=7.1,<7.4", + "sphinxcontrib-apidoc==0.3.0", + "jupyter-book>=1.0.2,<1.1", + "pyyaml<6.1" +] +all = ["snowexsql[dev,docs]"] + +[project.license] +file = "LICENSE" + +[project.urls] +Homepage = "https://github.com/SnowEx/snowexsql" +Documentation = "https://snowexsql.readthedocs.io" +Repository = "https://github.com/SnowEx/snowexsql.git" +Issues = "https://github.com/SnowEx/snowexsql/issues" + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "snowexsql/_version.py" + +[tool.hatch.version.raw-options] +local_scheme = "no-local-version" + +[tool.hatch.build.targets.sdist] +exclude = ["/tests"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4f513d1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -utm>=0.5.0,<1.0 -geoalchemy2>=0.6,<1.0 -geopandas>=0.7,<2.0 -psycopg2-binary>=2.9.0,<2.10.0 -rasterio>=1.1.5 -SQLAlchemy >= 2.0.0 diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 821db5f..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,12 +0,0 @@ --r requirements.txt -pip==23.3 -bump2version==0.5.11 -wheel==0.38.1 -watchdog==0.9.0 -flake8==3.7.8 -tox==3.14.0 -coverage==5.5 -twine==1.14.0 -pytest==6.2.4 -pytest-cov==2.12.1 -sphinx-autobuild<=2024.5 diff --git a/setup.py b/setup.py deleted file mode 100644 index 6abd690..0000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python - -"""The setup script.""" - -from setuptools import setup, find_packages - -with open('README.rst') as readme_file: - readme = readme_file.read() - -with open('docs/history.rst') as history_file: - history = history_file.read() - -with open('requirements.txt') as req: - requirements = req.read().split('\n') - -test_requirements = ['pytest>=3'] + requirements - -setup( - author="Micah Johnson", - python_requires='>=3.8', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10' - ], - description="SQL Database software for SnowEx data", - install_requires=requirements, - long_description=readme + '\n\n' + history, - long_description_content_type='text/x-rst', - include_package_data=True, - keywords='snowexsql', - name='snowexsql', - packages=find_packages(include=['snowexsql', 'snowexsql.*']), - test_suite='tests', - tests_require=test_requirements, - url='https://github.com/SnowEx/snowexsql', - version='0.5.0', - zip_safe=False, -) diff --git a/snowexsql/__init__.py b/snowexsql/__init__.py index ad767ed..50fc225 100644 --- a/snowexsql/__init__.py +++ b/snowexsql/__init__.py @@ -1,4 +1,6 @@ """Top-level package for snowexsql.""" +from ._version import __version__ # noqa + __author__ = """SnowEx SQL Development Team""" -__version__ = '0.5.0' +__version__ = __version__