Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch setup configurations to pyproject.toml #78

Merged
merged 6 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,3 @@ exclude =
.idea,
.mypy_cache,
.pytest_cache,

[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=79
skip=
e3sm_diags/e3sm_diags_driver.py

[pycodestyle]
max-line-length = 79
exclude =
.git
docs
.idea
.mypy_cache
.pytest_cache
14 changes: 11 additions & 3 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ jobs:
with:
python-version: "3.10"

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
id: file_changes
uses: trilom/[email protected]
with:
output: ' '

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
name: Install and Run Pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}

build:
name: test pyremap - python ${{ matrix.python-version }}
Expand Down Expand Up @@ -91,7 +99,7 @@ jobs:
name: Install pyremap
run: |
conda create -n pyremap_dev --file dev-spec.txt \
python=${{ matrix.python-version }}
python=${{ matrix.python-version }}
conda activate pyremap_dev
python -m pip install -vv --no-deps --no-build-isolation .

Expand All @@ -100,6 +108,6 @@ jobs:
env:
CHECK_IMAGES: False
run: |
conda activate pyremap_dev
pytest --pyargs pyremap
conda activate pyremap_dev
pytest --pyargs pyremap

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: 7.1.1
hooks:
- id: flake8
args: ["--config=setup.cfg"]
args: ["--config=.flake8"]
additional_dependencies: [flake8-isort]

# https://pre-commit.ci/#configuration
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include pyremap *.nc
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[project]
name = "pyremap"
dynamic = ["version"]
authors = [
{ name="Xylar Asay-Davis", email="[email protected]" },
{ name="Althea Denlinger" },
]
description = "Python remapping tools for climate and earth system models"
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
# these are only for searching/browsing projects on PyPI
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",

"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
]

dependencies = [
"dask",
"netcdf4",
"numpy",
"pyproj",
"scipy",
"xarray>=0.10.0",
]

[tool.isort]
multi_line_output = "3"
include_trailing_comma = true
force_grid_wrap = "0"
use_parentheses = true
line_length = "79"

[tool.mypy]
python_version = "3.10"
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true

[build-system]
requires = ["setuptools>=60"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
exclude = ["ci*", "docs*", "licenses*", "examples*"]

[tool.setuptools.dynamic]
version = { attr = "pyremap.__version__" }

[project.urls]
Documentation = "https://mpas-dev.github.io/pyremap/stable/"
"Bug Tracker" = "https://github.com/MPAS-Dev/pyremap/issues"
44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

Loading