-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from wwPDB/hatch
Convert to using hatch for build tool
- Loading branch information
Showing
196 changed files
with
1,319 additions
and
1,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "wwpdb/mock-data"] | ||
path = wwpdb/mock-data | ||
url = ../py-onedep_mock_data.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "wwpdb.utils.oe-util" | ||
dynamic = ["version"] | ||
description = "wwPDB workflow engine utils" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
authors = [ | ||
{ name = "Ezra Peisach", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
] | ||
dependencies = [ | ||
"mmcif.utils", | ||
"OpenEye-toolkits ; python_version >= '3'", | ||
"OpenEye-toolkits-python2.7-ucs2-linux-x64 == 2016.6.1; python_version == '2.7' and sys_platform=='linux2'", | ||
"wwpdb.utils.cc_dict_util >= 0.2", | ||
] | ||
|
||
requires-python = ">=3.6" | ||
|
||
# https://hatch.pypa.io/latest/how-to/environment/dependency-resolution/ | ||
[project.optional-dependencies] | ||
dev = [ | ||
"check-manifest", | ||
] | ||
test = [ | ||
"coverage", | ||
] | ||
|
||
[project.scripts] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/rcsb/py-wwpdb_apps_wf_engine_utils" | ||
|
||
[tool.hatch.version] | ||
path = "wwpdb/utils/oe_util/__init__.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = [ | ||
"/wwpdb", | ||
] | ||
|
||
exclude = ["/wwpdb/mock-data", "/wwpdb/utils/oe_util/Archive"] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["wwpdb"] | ||
|
||
exclude = ["/wwpdb/mock-data", "/wwpdb/utils/oe_util/Archive"] | ||
|
||
#=================================== Ruff basics =============================# | ||
[tool.ruff] | ||
|
||
line-length = 120 # 120 is hatch's default via 'hatch init' | ||
include = [ | ||
"*.py", # Source | ||
"pyproject.toml", # This file (RUF rules only) | ||
"*.ipynb", # Jupyter notebooks | ||
] | ||
|
||
exclude = ["Archive"] | ||
|
||
# | ||
#=================================== Ruff lint ==============================# | ||
|
||
[tool.ruff.lint] | ||
|
||
# | ||
# ------------------------- Ruff misc. options ---------------------- | ||
preview = true | ||
explicit-preview-rules = true | ||
|
||
ignore = [ | ||
"C402", # Unnecessary generator (rewrite as a `dict` comprehension) | ||
"EXE001", # Shebang is present but file is not executabl | ||
"FBT002", # Boolean default positional argument in function definition | ||
"FBT001", # Boolean-typed positional argument in function definition | ||
"FURB113", # Use `stPL.extend(...)` instead of repeatedly calling `stPL.append()` | ||
"INP001", # File `xx` is part of an implicit namespace package. Add an `__init__.py | ||
"N801", # Class name `markdownTests` should use CapWords convention | ||
"N802", # Function name should be lowercase | ||
"N803", # Argument name should be lowercase | ||
"N806", # in function should be lowercase | ||
"N815", # Caiable... in class shope should not be mixedCase | ||
"N816", # Variable in global scope should not be mixedCase | ||
"N999", # Invalid module name, | ||
"PERF401", # Use a list comprehension to create a transformed list | ||
"PERF403", # Use a dictionary comprehension instead of a for-loop | ||
"PLR1714", # Consider merging multiple comparisons | ||
"PLR2004", # Magic value used in comparison, consider replacing | ||
"PLR6201", # Use a `set` literal when testing for membership | ||
"PLR6301", # Method `` could be a function, class method, or static method | ||
"PLW1514", # `open` in text mode without explicit `encoding` argument | ||
"PT009", # Use a regular `assert` instead of unittest-style `assertGreater` | ||
"RET504", # Unnecessary assignment to `X` before `return` statement | ||
"RUF100", # RUF REMOVES FLAKE8 noqa! | ||
"S110", # `try`-`except`-`pass` detected, consider logging the exception | ||
"SIM102", # Use a single `if` statement instead of nested `if` statements | ||
"SIM103", # Return the condition directly | ||
"SIM108", # Use ternary operator | ||
"SIM115", # Use context handler for opening files | ||
"TRY300", # Consider moving this statement to an `else` block | ||
"TRY400", # Use `logging.exception` instead of `logging.error` | ||
"TRY401", # Redundant exception object included in `logging.exception` call | ||
"UP008", # Use `super()` instead of `super(__class__, self)` | ||
"UP031" # Use format specifiers instead of percent format | ||
] | ||
|
||
# -------------------- default environment scripts ------------------ | ||
[tool.hatch.envs.default] | ||
skip-install = true | ||
dependencies = ["mypy", "ruff >=0.6.9", "wwpdb.utils.testing", "OpenEye-toolkits~=2022.1.1"] | ||
|
||
[tool.hatch.envs.default.env-vars] | ||
PIP_EXTRA_INDEX_URL = "https://pypi.anaconda.org/OpenEye/simple" | ||
|
||
|
||
[tool.hatch.envs.default.scripts] | ||
|
||
# 'format' formats and fixes issues but does not complain | ||
format = [ | ||
"ruff format", | ||
"ruff check --fix-only", | ||
] | ||
|
||
# 'format-python' just excludes Prettier | ||
format-python = ["ruff format", "ruff check --fix-only"] | ||
|
||
# 'check' only checks but never fixes | ||
check = ["ruff check --no-fix .", "mypy --non-interactive --install-types -p wwpdb -p tests"] | ||
|
||
# only checks with ruff (mypy has a lot of false positives) | ||
check-ruff = "ruff check --no-fix . {args}" | ||
|
||
# to complement 'check-ruff' | ||
check-mypy = "mypy --non-interactive --install-types wwpdb tests {args}" | ||
|
||
# only check security via Bandit; we require these rules to pass | ||
check-security = "ruff check --select S --no-fix ." | ||
|
||
# ----------------------- testing environment ---------------- | ||
[tool.hatch.envs.hatch-test] | ||
dependencies = ["tox"] | ||
|
||
[tool.hatch.envs.hatch-test.scripts] | ||
run = ["tox"] | ||
|
||
|
||
# ------------------------- Mypy disable --------- | ||
[[tool.mypy.overrides]] | ||
module = ["wwpdb.*", "openeye.*", "mmcif_utils.*", "mmcif.*"] | ||
ignore_missing_imports = true | ||
|
||
[tool.mypy] | ||
exclude = [ | ||
"test-output", | ||
] | ||
|
||
# ------------------------ ruff disable until typing added | ||
[tool.ruff.lint.per-file-ignores] | ||
"awwpdb/utils/config/ConfigInfoData.py" = ["RUF012"] # typing.ClassVar | ||
"wwpdb/utils/config/ConfigInfoData.py" = ["SLF001", "RUF012", "F401"] # Private member access, should use typing.ClassVar, do not remove unused imports | ||
|
File renamed without changes.
Oops, something went wrong.