From 32ed37e307f4a1c5360c644b31d591c9c3d6a501 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 17 Feb 2025 23:05:09 -0500 Subject: [PATCH] Remove hatchling --- pyproject.toml | 140 ------------------------------------------------- setup.cfg | 7 +++ setup.py | 65 +++++++++++++++++++++++ 3 files changed, 72 insertions(+), 140 deletions(-) delete mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 5244226..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,140 +0,0 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "wwpdb.utils.seqdb-v2" -dynamic = ["version"] -description = "wwPDB Sequence search utilities" -readme = "README.md" -license = "Apache-2.0" -authors = [ - { name = "Ezra Peisach", email = "ezra.peisach@rcsb.org" }, -] -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", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", -] -dependencies = [ - "mmcif", - "mmcif.utils", - "requests", - "wwpdb.utils.config >= 0.33", -] - -requires-python = ">=3.6" - - -[project.urls] -Homepage = "https://github.com/rcsb/py-wwpdb_utils_seqdb_v2" - -[tool.hatch.version] -path = "wwpdb/utils/seqdb_v2/__init__.py" - -[tool.hatch.build.targets.sdist] -include = [ - "/wwpdb", -] -exclude = ["/wwpdb/mock-data"] - -[tool.hatch.build.targets.wheel] -packages = ["wwpdb"] - -exclude = ["/wwpdb/mock-data"] - -#=================================== Ruff basics =============================# - -line-length = 120 # 120 is hatch's default via 'hatch init' -include = [ - "*.py", # Source - "pyproject.toml", # This file (RUF rules only) - "*.ipynb", # Jupyter notebooks -] - -# -#=================================== Ruff lint ==============================# - -[tool.ruff.lint] - -# -# ------------------------- Ruff misc. options ---------------------- -preview = true -explicit-preview-rules = true - -ignore = [ - "FBT002", # Boolean default 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 - "N816", # Variable in global scope should not be mixedCase - "N999", # Invalid module name, - "PERF401", # Use a list comprehension to create a transformed list - "PLR1714", # Consider merging multiple comparisons - "PLR2004", # Magic value used in comparison, consider replacing - "PLR6201", # Use a `set` literal when testing for membership - "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 - "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 - "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", "requests-mock"] - - -[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 = ["mmcif.*", "mmcif_utils.*", "wwpdb.utils.config.*"] -ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..53bb53d --- /dev/null +++ b/setup.cfg @@ -0,0 +1,7 @@ +[bdist_wheel] +# use py2.py3 tag for pure-python dist: +universal=1 + +[metadata] +description-file = README.md + diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..cb77000 --- /dev/null +++ b/setup.py @@ -0,0 +1,65 @@ +# File: setup.py +# Date: 3-Oct-2018 +# +# Update: +# +import re + +from setuptools import find_packages +from setuptools import setup + +packages = [] +thisPackage = "wwpdb.utils.seqdb_v2" + +with open("wwpdb/utils/seqdb_v2/__init__.py", "r") as fd: + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError("Cannot find version information") + +setup( + name=thisPackage, + version=version, + description="wwPDB Sequence search utilities", + long_description="See: README.md", + author="Ezra Peisach", + author_email="ezra.peisach@rcsb.org", + url="https://github.com/rcsb/py-wwpdb_utils_seqdb_v2", + # + license="Apache 2.0", + classifiers=[ + "Development Status :: 3 - Alpha", + # 'Development Status :: 5 - Production/Stable', + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + ], + # + install_requires=["mmcif", "mmcif.utils", "wwpdb.utils.config ~= 0.33", "requests"], + packages=find_packages(exclude=["wwpdb.utils.tests-seqdb", "mock-data", "tests.*"]), + package_data={ + # If any package contains *.md or *.rst ... files, include them: + "": ["*.md", "*.rst", "*.txt", "*.cfg"], + }, + # + # These basic tests require no database services - + test_suite="wwpdb.utils.tests-seqdb", + tests_require=["tox"], + # + # Not configured ... + extras_require={ + "dev": ["check-manifest"], + "test": ["coverage"], + }, + # Added for + command_options={"build_sphinx": {"project": ("setup.py", thisPackage), "version": ("setup.py", version), "release": ("setup.py", version)}}, + # This setting for namespace package support - + zip_safe=False, +)