Skip to content

Commit

Permalink
Merge setup.py into pyproject.toml (#304)
Browse files Browse the repository at this point in the history
* merge setup.py into pyproject.toml

* exclude tests in pyproject.toml [tool.setuptools.packages.find] and del MANIFEST.in

* bump ruff target-version = "py39"

* .gitattributes docs_rst/**/* linguist-documentation

* move sentry-sdk to project.optional-dependencies "error-statistics"
  • Loading branch information
janosh authored Nov 9, 2023
1 parent 1d31ba5 commit 141209b
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 75 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# declare HTML, rST and test files as vendored/docs to exclude them when calculating repo languages on GitHub
**/test_files/**/* linguist-vendored
docs/**/* linguist-generated
docs_rst/**/* linguist-documentation
docs/**/* linguist-documentation
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
rev: v0.1.5
hooks:
- id: ruff
args: [--fix, --ignore, D]
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

8 changes: 2 additions & 6 deletions custodian/custodian.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@
# not have CUSTODIAN_REPORTING_OPT_IN set to True, then
# Sentry will not be enabled.

SENTRY_DSN = None
if "SENTRY_DSN" in os.environ:
SENTRY_DSN = os.environ["SENTRY_DSN"]
elif "CUSTODIAN_REPORTING_OPT_IN" in os.environ and literal_eval(
os.environ.get("CUSTODIAN_REPORTING_OPT_IN", "False").title()
):
SENTRY_DSN = os.getenv("SENTRY_DSN")
if literal_eval(os.getenv("CUSTODIAN_REPORTING_OPT_IN", "False").title()):
# check for environment variable to automatically set SENTRY_DSN
# will set for True, true, TRUE, etc.
SENTRY_DSN = "https://0f7291738eb042a3af671df9fc68ae2a@sentry.io/1470881"
Expand Down
14 changes: 7 additions & 7 deletions custodian/vasp/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
logger = logging.getLogger(__name__)


VASP_INPUT_FILES = {"INCAR", "POSCAR", "POTCAR", "KPOINTS"}
VASP_INPUT_FILES = ("INCAR", "POSCAR", "POTCAR", "KPOINTS")

VASP_OUTPUT_FILES = [
VASP_OUTPUT_FILES = (
"DOSCAR",
"INCAR",
"KPOINTS",
Expand All @@ -40,13 +40,13 @@
"CONTCAR",
"IBZKPT",
"OUTCAR",
]
)

VASP_NEB_INPUT_FILES = {"INCAR", "POTCAR", "KPOINTS"}
VASP_NEB_INPUT_FILES = ("INCAR", "POTCAR", "KPOINTS")

VASP_NEB_OUTPUT_FILES = ["INCAR", "KPOINTS", "POTCAR", "vasprun.xml"]
VASP_NEB_OUTPUT_FILES = ("INCAR", "KPOINTS", "POTCAR", "vasprun.xml")

VASP_NEB_OUTPUT_SUB_FILES = [
VASP_NEB_OUTPUT_SUB_FILES = (
"CHG",
"CHGCAR",
"CONTCAR",
Expand All @@ -61,7 +61,7 @@
"OUTCAR",
"WAVECAR",
"XDATCAR",
]
)


class VaspJob(Job):
Expand Down
66 changes: 65 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "custodian"
version = "2023.10.9"
description = "A simple JIT job management framework in Python."
authors = [
{ name = "Shyue Ping Ong", email = "ongsp@ucsd.edu" },

{ name = "Matthew Horton" },
{ name = "Samuel M. Blau" },
{ name = "Stephen Dacek" },
{ name = "William Davidson Richards" },
{ name = "Xiaohui Qu" },

{ name = "Janosh Riebesell", email = "janosh@lbl.gov" },
]
maintainers = [{ name = "Janosh Riebesell" }, { name = "Shyue Ping Ong" }]
readme = "README.md"
keywords = ["jit", "job", "just-in-time", "management", "vasp"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries :: Python Modules",
]
license = { file = "LICENSE" }
requires-python = ">=3.9"

dependencies = ["monty>=2.0.6", "psutil", "ruamel.yaml>=0.15.6"]

[project.optional-dependencies]
vasp = ["pymatgen"]
nwchem = ["pymatgen"]
qchem = ["pymatgen"]
dev = ["mypy", "pre-commit", "pytest", "pytest-cov", "ruff"]
error-statistics = ["sentry-sdk>=0.8.0"]

[project.scripts]
cstdn = "custodian.cli.cstdn:main"
run_vasp = "custodian.cli.run_vasp:main"
run_nwchem = "custodian.cli.run_nwchem:main"
converge_kpoints = "custodian.cli.converge_kpoints:main"
converge_geometry = "custodian.cli.converge_geometry:main"

[project.urls]
Docs = "https://materialsproject.github.io/custodian"
Repo = "https://github.com/materialsproject/custodian"
Package = "https://pypi.org/project/custodian"

[tool.setuptools.packages.find]
include = ["custodian*"]
exclude = ["*.tests", "*.tests.*", "test_files"]

[tool.ruff]
target-version = "py38"
target-version = "py39"
line-length = 120
select = [
"B", # flake8-bugbear
Expand Down
54 changes: 0 additions & 54 deletions setup.py

This file was deleted.

0 comments on commit 141209b

Please sign in to comment.