Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
hooks:
- id: mypy
name: mypy-ndsl
args: [--config-file, setup.cfg]
args: ["--config-file", "pyproject.toml"]
additional_dependencies: [types-PyYAML]
files: ndsl
exclude: |
Expand All @@ -39,7 +39,6 @@ repos:
- id: flake8
name: flake8
language_version: python3
args: [--config, setup.cfg]
exclude: |
(?x)^(
.*/__init__.py |
Expand All @@ -48,4 +47,4 @@ repos:
name: flake8 __init__.py files
files: "__init__.py"
# ignore unused import error in __init__.py files
args: ["--ignore=F401,E203", --config, setup.cfg]
args: ["--ignore=F401,E203"]
76 changes: 76 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[build-system]
requires = ["setuptools >= 77.0.3"]
build-backend = "setuptools.build_meta"

[project]
name = "ndsl"
version = "2025.05.00"
dynamic = ["dependencies"]
requires-python = ">=3.11"
Comment thread
romanc marked this conversation as resolved.
Outdated
authors = [{name = "NOAA/NASA"}]
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE.txt", "ndsl/viz/fv3/README.md"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
Comment thread
romanc marked this conversation as resolved.
Outdated
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]

[project.optional-dependencies]
docs = ["mkdocs-material"]
demos = ["ipython", "ipykernel"]
test = ["pytest", "pytest-subtests", "coverage"]
develop = [
"ndsl[docs]",
"ndsl[demos]",
"ndsl[test]",
"pre-commit",
"pyproject-flake8"
]
extras = [
"ndsl[docs]",
"ndsl[demos]",
"ndsl[test]",
"ndsl[develop]",
]

[project.scripts]
ndsl-serialbox_to_netcdf = "ndsl.stencils.testing.serialbox_to_netcdf:entry_point"

[project.urls]
Repository = "https://github.com/NOAA-GFDL/NDSL"

[tool.setuptools.packages.find]
include = ["ndsl", "ndsl.*"]

[tool.setuptools]
include-package-data = true

[tool.flake8]
exclude = ["docs"]
extend-ignore = ["E203","E302","E704","F841","W293","E501","W503"]
max-line-length = 88

[tool.isort]
profile = "black"
lines_after_imports = 2
default_section = "THIRDPARTY"
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
known_third_party = "f90nml,pytest,xarray,numpy,mpi4py,gt4py,dace"

[tool.mypy]
ignore_missing_imports = "true"
follow_imports = "normal"
namespace_packages = "true"
strict_optional = "false"
warn_unreachable = "true"
explicit_package_bases = "true"

[tool.coverage.run]
parallel = true
branch = true
omit = ["tests/*", "*gt_cache*", ".dacecache*", "external/*", "__init__.py"]
source_pkgs = "ndsl"
42 changes: 2 additions & 40 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
from typing import List

from setuptools import find_namespace_packages, setup
from setuptools import setup


def local_pkg(name: str, relative_path: str) -> str:
Expand All @@ -11,19 +11,6 @@ def local_pkg(name: str, relative_path: str) -> str:
return path
Comment thread
romanc marked this conversation as resolved.
Outdated


docs_requirements = ["mkdocs-material"]
demos_requirements = ["ipython", "ipykernel"]
test_requirements = ["pytest", "pytest-subtests", "coverage"]

develop_requirements = test_requirements + docs_requirements + ["pre-commit"]

extras_requires = {
"demos": demos_requirements,
"develop": develop_requirements,
"docs": docs_requirements,
"test": test_requirements,
}

requirements: List[str] = [
Comment thread
romanc marked this conversation as resolved.
Outdated
local_pkg("gt4py", "external/gt4py"),
local_pkg("dace", "external/dace"),
Expand All @@ -42,29 +29,4 @@ def local_pkg(name: str, relative_path: str) -> str:
]


setup(
author="NOAA/NASA",
python_requires=">=3.11",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
],
install_requires=requirements,
extras_require=extras_requires,
name="ndsl",
license="Apache 2.0 license",
packages=find_namespace_packages(include=["ndsl", "ndsl.*"]),
include_package_data=True,
url="https://github.com/NOAA-GFDL/NDSL",
version="2025.05.00",
zip_safe=False,
entry_points={
"console_scripts": [
"ndsl-serialbox_to_netcdf = ndsl.stencils.testing.serialbox_to_netcdf:entry_point",
]
},
)
setup(install_requires=requirements)