diff --git a/setup.cfg b/.flake8 similarity index 84% rename from setup.cfg rename to .flake8 index 8edefbf..48215ff 100644 --- a/setup.cfg +++ b/.flake8 @@ -1,6 +1,3 @@ -[bdist_wheel] -universal = 1 - [flake8] max-line-length = 88 exclude = docs, diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index d844d0e..c7096b9 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -13,9 +13,9 @@ jobs: python-version: '3.10' - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install -U setuptools wheel twine - - name: Build and check - run: | - python setup.py sdist bdist_wheel - twine check dist/* + python -m pip install --upgrade pip + python -m pip install -U build twine + - name: Build and check source tarball + run: python -m build + - name: Twine check + run: twine check dist/* diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index dd0bde4..f28a953 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -20,9 +20,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -U setuptools setuptools_scm wheel twine + python -m pip install -U build twine - name: Build and check source tarball - run: python setup.py sdist bdist_wheel + run: python -m build - name: Twine check run: twine check dist/* - name: Publish distribution to PyPI diff --git a/.github/workflows/run-pytest-tests.yml b/.github/workflows/run-pytest-tests.yml index f3ff65f..a0818f9 100644 --- a/.github/workflows/run-pytest-tests.yml +++ b/.github/workflows/run-pytest-tests.yml @@ -17,19 +17,15 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements_dev.txt - name: Setup yt_xarray run: | - python -m pip install -e . + python -m pip install --upgrade pip + python -m pip install -e .[full,test] - name: Run Tests run: pytest --cov=./ --cov-report=xml:coverage/coverage.xml # https://github.com/marketplace/actions/codecov#example-workflowyml-with-codecov-action - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v3 with: directory: ./coverage/ diff --git a/.github/workflows/weekly-test.yml b/.github/workflows/weekly-test.yml index 5e2783a..a3b37a7 100644 --- a/.github/workflows/weekly-test.yml +++ b/.github/workflows/weekly-test.yml @@ -20,11 +20,9 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements_dev.txt - name: Setup yt_xarray - run: python -m pip install -e . + run: | + python -m pip install --upgrade pip + python -m pip install -e .[full,test] - name: Run Tests run: pytest -v . diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5401e83..0b49008 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,6 +14,7 @@ build: # Optionally declare the Python requirements required to build your docs python: install: - - requirements: requirements.txt - - requirements: requirements_dev.txt - - requirements: requirements_docs.txt + - method: pip + path: . + extra_requirements: + - docs diff --git a/MANIFEST.in b/MANIFEST.in index 4642861..75e7757 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ include *.yaml include Makefile include tox.ini include .coveragerc +include .flake8 recursive-include tests * recursive-exclude * __pycache__ recursive-exclude * *.py[co] diff --git a/pyproject.toml b/pyproject.toml index 4d4f9d7..9bff91b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,40 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "yt_xarray" +version = "0.1.4" +authors = [ + { name="Chris Havlin", email="chris.havlin@gmail.com" }, +] +description="interface between yt and xarray" +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies=['yt>=4.2.0', 'h5py>=3.4.0', 'pooch>=1.5.1', 'xarray'] + +[project.urls] +"Homepage" = "https://github.com/data-exp-lab/yt_xarray" +"Bug Tracker" = "https://github.com/data-exp-lab/yt_xarray/issues" + +[project.optional-dependencies] +full = ["netCDF4", "scipy", "dask[complete]"] +test = ["pytest", "pytest-cov"] +docs = ["Sphinx==1.8.5", "jinja2<3.1.0", "nbsphinx"] + [tool.black] line-length = 88 -target-version = ['py37'] +target-version = ['py310'] [tool.isort] profile = "black" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1585694..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ - -yt>=4.2.0 -h5py>=3.4.0 -pooch>=1.5.1 -xarray diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 49bf8cb..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,9 +0,0 @@ -pip -twine -pre-commit -netCDF4 -h5py -scipy -pytest -pytest-cov -dask[complete] diff --git a/requirements_docs.txt b/requirements_docs.txt index 5371437..e69de29 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -1,3 +0,0 @@ -Sphinx==1.8.5 -jinja2<3.1.0 -nbsphinx diff --git a/setup.py b/setup.py deleted file mode 100644 index 3998919..0000000 --- a/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python - -"""The setup script.""" - -from setuptools import find_packages, setup - -with open("requirements.txt") as reqs_file: - requirements = reqs_file.read().strip().split("\n") - -with open("README.md", "r") as readme_file: - readme_md = readme_file.read() - - -test_requirements = [ - "pytest>=3", -] - -setup( - author="Chris Havlin", - author_email="chris.havlin@gmail.com", - python_requires=">=3.9", - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - description="interface between yt and xarray", - install_requires=requirements, - license="MIT license", - long_description=readme_md, - long_description_content_type="text/markdown", - include_package_data=True, - keywords="yt_xarray", - name="yt_xarray", - packages=find_packages(include=["yt_xarray", "yt_xarray.*"]), - test_suite="tests", - tests_require=test_requirements, - url="https://github.com/data-exp-lab/yt_xarray", - version="0.1.4", - zip_safe=False, -)