Skip to content

Commit 3d2f069

Browse files
authored
Merge pull request #244 from altheaden/switch-to-pyproject
Switch setup configuration to to `pyproject.toml`
2 parents fa70217 + abd337d commit 3d2f069

File tree

5 files changed

+95
-98
lines changed

5 files changed

+95
-98
lines changed

.flake8

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[flake8]
2+
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
3+
ignore =
4+
# line break after operator
5+
W504
6+
# Max width of Github code review is 79 characters
7+
max-line-length = 79
8+
max-complexity = 18
9+
per-file-ignores =
10+
*/__init__.py: F401
11+
exclude =
12+
.git,
13+
docs,
14+
.idea,
15+
.mypy_cache,
16+
.pytest_cache,

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ repos:
3030
rev: 7.1.1
3131
hooks:
3232
- id: flake8
33-
args: ["--config=setup.cfg"]
33+
args: ["--config=.flake8"]
3434
additional_dependencies: [flake8-isort]
3535

3636
# Can run individually with `pre-commit run mypy --all-files`
3737
- repo: https://github.com/pre-commit/mirrors-mypy
3838
rev: v1.11.2
3939
hooks:
4040
- id: mypy
41-
args: ["--config=setup.cfg", "--show-error-codes"]
41+
args: ["--config=pyproject.toml", "--show-error-codes"]
4242
verbose: true
4343
additional_dependencies: ['types-requests']
4444

pyproject.toml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[project]
2+
name = "polaris"
3+
dynamic = ["version"]
4+
authors = [
5+
{ name="Xylar Asay-Davis", email="[email protected]" },
6+
{ name="Althea Denlinger", email="[email protected]" }
7+
]
8+
description = "Testing and analysis for Omega, MPAS-Ocean, MALI and MPAS-Seaice"
9+
license = {file = "LICENSE"}
10+
readme = "README.md"
11+
requires-python = ">=3.9"
12+
classifiers = [
13+
# these are only for searching/browsing projects on PyPI
14+
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
19+
"License :: OSI Approved :: BSD License",
20+
"Operating System :: OS Independent",
21+
]
22+
23+
dependencies = [
24+
"cartopy",
25+
"cmocean",
26+
"importlib_resources",
27+
"ipython",
28+
"jigsawpy",
29+
"jupyter",
30+
"lxml",
31+
"matplotlib>=3.9.0",
32+
"netcdf4",
33+
"numpy>=2.0,<3.0",
34+
"progressbar2",
35+
"pyamg>=4.2.2",
36+
"pyproj",
37+
"ruamel.yaml",
38+
"requests",
39+
"scipy>=1.8.0",
40+
"shapely>=2.0,<3.0",
41+
"xarray",
42+
]
43+
44+
[tool.isort]
45+
multi_line_output = "3"
46+
include_trailing_comma = true
47+
force_grid_wrap = "0"
48+
use_parentheses = true
49+
line_length = "79"
50+
skip = ["e3sm_diags/e3sm_diags_driver.py"]
51+
52+
[tool.mypy]
53+
python_version = "3.10"
54+
check_untyped_defs = true
55+
ignore_missing_imports = true
56+
warn_unused_ignores = true
57+
warn_redundant_casts = true
58+
warn_unused_configs = true
59+
60+
[build-system]
61+
requires = ["setuptools>=60"]
62+
build-backend = "setuptools.build_meta"
63+
64+
[tool.setuptools.packages.find]
65+
exclude = ["docs*", "conda*"]
66+
67+
[tool.setuptools.dynamic]
68+
version = { attr = "polaris.version.__version__" }
69+
70+
# evolution of options.entry-points
71+
[project.scripts]
72+
polaris = "polaris.__main__:main"
73+
mpas_to_yaml = "polaris.yaml:main_mpas_to_yaml"
74+
75+
[project.urls]
76+
Documentation = "https://docs.e3sm.org/polaris"
77+
"Bug Tracker" = "https://github.com/E3SM-Project/polaris/issues"

setup.cfg

Lines changed: 0 additions & 92 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)