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

change to pyproject.toml and add pre-commit to CI #73

Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
python - V
python -m pip install -e . --no-deps --force-reinstall

- name: pre-commit
shell: micromamba-shell {0}
run: |
pip install pre-commit
pre-commit install --install-hooks
pre-commit run --all-files

- name: Running Tests
shell: bash -l {0}
run: |
Expand Down
18 changes: 4 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,18 @@ repos:
# Ruff version.
rev: "v0.4.7"
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
# Copied from setup.cfg
exclude: "properties|asv_bench|docs"
additional_dependencies: [
# Type stubs
types-python-dateutil,
types-pkg_resources,
types-PyYAML,
types-pytz,
# Dependencies that are typed
numpy,
typing-extensions>=4.1.0,
]
"types-python-dateutil",
"types-PyYAML",
"types-pytz"
]

- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
Expand Down
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[project]
name = "cstar"
version = "0.0.0"
description = "Computational systems for tracking ocean carbon"
readme = "README.md"
urls = { repository = "https://github.com/CWorthy-ocean/C-Star", homepage = "https://www.cworthy.org" }

authors = [
{ name = "Dafydd Stephenson", email = "[email protected]" },
{ name = "Thomas Nicholas", email = "[email protected]" },
{ name = "Nora Loose", email = "[email protected]" },
{ name = "Matt Long", email = "[email protected]" }
]
license = { text = "GPL-3.0-only" }

classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Oceanography"
]
requires-python = ">=3.10"

dependencies = [
"python-dateutil>=2.8.2",
"PyYAML==6.0.2",
"pooch>=1.8.1"
]

keywords = ["MCDR", "CDR", "ocean carbon", "climate"]

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project.optional-dependencies]
dev = []

# Configuration for mypy type checker
[tool.mypy]
ignore_missing_imports = true
exclude = "properties|asv_bench|docs"

# Configuration for ruff linter and formatter
[tool.ruff]
fix = true

[tool.pre-commit]
config = ".pre-commit-config.yaml"

[tool.setuptools.packages.find]
# Automatically find the packages
where = ["."]
include = ["cstar"]
exclude = ["tests*", "docs*", "examples*"]

[tool.setuptools]
include-package-data = true
25 changes: 0 additions & 25 deletions setup.py

This file was deleted.

Loading