From 4641b3a7e86953118bb5fe437109673ceaecdcef Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 17 Dec 2024 09:44:07 -0600 Subject: [PATCH 1/8] Switch back to using `pyproject.toml` to build --- .lgtm.yml | 12 -------- README.md | 2 +- pyproject.toml | 69 +++++++++++++++++++++++++++++++++++++++++ setup.cfg | 44 +------------------------- setup.py | 84 -------------------------------------------------- 5 files changed, 71 insertions(+), 140 deletions(-) delete mode 100644 .lgtm.yml create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index fc39d5f1..00000000 --- a/.lgtm.yml +++ /dev/null @@ -1,12 +0,0 @@ -# Configure LGTM for this package - -extraction: - python: # Configure Python - python_setup: # Configure the setup - version: 3 # Specify Version 3 -path_classifiers: - library: - - versioneer.py # Set Versioneer.py to an external "library" (3rd party code) - - devtools/* - generated: - - openff/nagl/_version.py diff --git a/README.md b/README.md index 32a9d0fc..4110c275 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ NAGL | **Latest release** | [![Last release tag](https://img.shields.io/github/release-pre/openforcefield/openff-nagl.svg)](https://github.com/openforcefield/openff-nagl/releases) ![GitHub commits since latest release (by date) for a branch](https://img.shields.io/github/commits-since/openforcefield/openff-nagl/latest) [![Documentation Status](https://readthedocs.org/projects/openff-nagl/badge/?version=latest)](https://docs.openforcefield.org/projects/nagl/en/latest/?badge=latest) | | :----------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Status** | [![GH Actions Status](https://github.com/openforcefield/openff-nagl/actions/workflows/gh-ci.yaml/badge.svg)](https://github.com/openforcefield/openff-nagl/actions?query=branch%3Amain+workflow%3Agh-ci) [![codecov](https://codecov.io/gh/openforcefield/openff-nagl/branch/main/graph/badge.svg)](https://codecov.io/gh/openforcefield/openff-nagl/branch/main) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/openforcefield/openff-nagl.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/openforcefield/openff-nagl/context:python) | +| **Status** | [![GH Actions Status](https://github.com/openforcefield/openff-nagl/actions/workflows/gh-ci.yaml/badge.svg)](https://github.com/openforcefield/openff-nagl/actions?query=branch%3Amain+workflow%3Agh-ci) [![codecov](https://codecov.io/gh/openforcefield/openff-nagl/branch/main/graph/badge.svg)](https://codecov.io/gh/openforcefield/openff-nagl/branch/main) | | **Community** | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12792526.svg)](https://doi.org/10.5281/zenodo.12792526) | A playground for applying graph convolutional networks to molecules, with a focus on learning continuous "atom-type" embeddings and from these classical molecule force field parameters. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f7402780 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,69 @@ +[build-system] +requires = [ + "setuptools" + "versioneer[toml]==0.29", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "openff-nagl" +description = "A playground for applying graph convolutional networks to molecules." +readme = "README.md" +license = { file = "LICENSE" } +authors = [ + {name = "Lily Wang", email = "lily.wang@openforcefield.org"}, +] +maintainers = [ + {name = "Lily Wang", email = "lily.wang@openforcefield.org"}, +] +requires-python = ">=3.10" +dynamic = ["version"] + +[tool.setuptools.packages] +find = {} + +[project.optional-dependencies] +test = [ + "pytest>=6.0", + "pytest-xdist>=2.5", + "pytest-cov>=3.0", +] +doc = [ + "sphinx>=1.8", + "openff-sphinx-theme @ git+https://github.com/openforcefield/openff-sphinx-theme.git@main", +] + +[project.scripts] +openff-nagl = "openff.nagl.cli:cli" + +[project.urls] +source = "https://github.com/openforcefield/openff-nagl" +documentation = "https://docs.openforcefield.org/projects/nagl/" + +[tool.pytest.ini_options] +testpaths = [ + "openff/nagl/tests", +] + +[tool.versioneer] +VCS = "git" +style = "pep440" +versionfile_source = "openff/nagl/_version.py" +versionfile_build = "openff/nagl/_version.py" +tag_prefix = "v" +parentdir_prefix = "openff-nagl-" + +[tool.coverage.run] +omit = [ + "*/*/_tests/*", + "openff/nagl/_version.py", +] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if TYPE_CHECKING:", + "raise NotImplementedError", + "@overload", +] diff --git a/setup.cfg b/setup.cfg index 5de9226b..6b3f0076 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,18 +1,3 @@ -# Helper file to handle all configs - -[coverage:run] -# .coveragerc to control coverage.py and pytest-cov -omit = - # Omit the tests - */*/tests/* - # Omit generated versioneer - openff/nagl/_version.py - -[coverage:report] -exclude_lines = - pragma: no cover - if TYPE_CHECKING: - [isort] multi_line_output = 3 include_trailing_comma = True @@ -20,40 +5,13 @@ force_grid_wrap = 0 use_parentheses = True line_length = 80 - -[yapf] -# YAPF, in .style.yapf files this shows up as "[style]" header -COLUMN_LIMIT = 80 -INDENT_WIDTH = 4 -USE_TABS = False - [flake8] # Flake8, PyFlakes, etc max-line-length = 80 exclude = versioneer.py -[versioneer] -# Automatic version numbering scheme -VCS = git -style = pep440 -versionfile_source = openff/nagl/_version.py -versionfile_build = openff/nagl/_version.py -tag_prefix = v - -[aliases] -test = pytest - -[tool:pytest] -testpaths = openff/nagl/tests - [build_sphinx] all-files = 1 source-dir = docs/ build-dir = docs/_build -warning-is-error = 1 - -[options] -packages = find_namespace: - -[options.packages.find] -include = ["openff.*"] \ No newline at end of file +warning-is-error = 1 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 7aed8acd..00000000 --- a/setup.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -OpenFF NAGL -A playground for applying graph convolutional networks to molecules. -""" -import sys -from setuptools import setup, find_namespace_packages -import versioneer - -short_description = "A playground for applying graph convolutional networks to molecules.".strip().split("\n")[0] - -# from https://github.com/pytest-dev/pytest-runner#conditional-requirement -needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) -pytest_runner = ['pytest-runner'] if needs_pytest else [] - -try: - with open("README.md", "r") as handle: - long_description = handle.read() -except: - long_description = "\n".join(short_description[2:]) - - -setup( - # Self-descriptive entries which should always be present - name='openff-nagl', - author='Lily Wang', - author_email='lily.wang@openforcefield.org', - description=short_description, - long_description=long_description, - long_description_content_type="text/markdown", - version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), - license='MIT', - - # Which Python importable modules should be included when your package is installed - # Handled automatically by setuptools. Use 'exclude' to prevent some specific - # subpackage(s) from being added, if needed - packages=find_namespace_packages(include=['openff.*']), - - # Optional include package data to ship with your package - # Customize MANIFEST.in if the general case does not suit your needs - # Comment out this line to prevent the files from being packaged with your software - include_package_data=True, - python_requires=">=3.10", # Python version restrictions - # Allows `setup.py test` to work correctly with pytest - setup_requires=[] + pytest_runner, - # Required packages, pulls from pip if needed - # do not use for Conda deployment - install_requires=[ - "click", - "click-option-group", - "tqdm", - "openff-toolkit", - "openff-units", - "pydantic", - "rdkit", - ], - # Additional entries you may want simply uncomment the lines you want and fill in the data - # url='openff-nagl.readthedocs.io/en/latest/', # Website - # platforms=['Linux', - # 'Mac OS-X', - # 'Unix', - # 'Windows'], # Valid platforms your code works on, adjust to your flavor - - # Manual control if final package is compressible or not, set False to prevent the .egg from being made - # zip_safe=False, - - extras_require={ - "test": [ - "pytest>=6.0", - "pytest-xdist>=2.5", - "pytest-cov>=3.0", - ], - "doc": [ - "sphinx>=1.8", - "openff-sphinx-theme @ git+https://github.com/openforcefield/openff-sphinx-theme.git@main", - ] - }, - - entry_points={ - "console_scripts": [ - "openff-nagl=openff.nagl._cli:cli", - ] - } -) From 2d6c4b3a0b3c7c4ab386e5c3bd3bbc0394ef1d23 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 17 Dec 2024 09:46:48 -0600 Subject: [PATCH 2/8] Update CHANGELOG --- docs/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b6e24452..52ffd2aa 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,11 @@ The rules for this file: * accompany each entry with github issue/PR number (Issue #xyz) --> +## Current development + +### Changed +- Switched build from using `setup.py` to `pyproject.toml`. + ## v0.5.0 -- 2024-11-06 ### Authors From 2e6233d0df1c46ab062ac19ee0899ce9d242031f Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 17 Dec 2024 10:10:27 -0600 Subject: [PATCH 3/8] Fix typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f7402780..66ee824f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools" + "setuptools", "versioneer[toml]==0.29", "wheel", ] From 4c09ed447812f121e3d99abd2b390917e045d857 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 17 Dec 2024 15:54:51 -0600 Subject: [PATCH 4/8] Use `pip install` --- .github/workflows/gh-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index fe3ae8e4..0739ed6b 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -150,7 +150,7 @@ jobs: - name: Build package run: | - python setup.py sdist + python -m pip install . - name: Check package build run: | From 29abc7e2779476b0601c92e32e0dddaec5242994 Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Mon, 13 Jan 2025 14:01:31 -0600 Subject: [PATCH 5/8] Update .github/workflows/gh-ci.yaml Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> --- .github/workflows/gh-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 0739ed6b..7ae039cb 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -150,7 +150,7 @@ jobs: - name: Build package run: | - python -m pip install . + python3 -m pip install --upgrade build - name: Check package build run: | From ed1fd456acde2cbd59872305f295bbc8f4f16ee4 Mon Sep 17 00:00:00 2001 From: Lily Wang <31115101+lilyminium@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:45:02 +1100 Subject: [PATCH 6/8] Update .github/workflows/gh-ci.yaml --- .github/workflows/gh-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 7ae039cb..ea7f93fd 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -151,6 +151,7 @@ jobs: - name: Build package run: | python3 -m pip install --upgrade build + python3 -m build - name: Check package build run: | From f1ad773aa72ebfd9a33978db0a83eb35c7038025 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 14 Jan 2025 10:29:48 +1100 Subject: [PATCH 7/8] switch hyphen to underscore in check --- .github/workflows/gh-ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index ea7f93fd..e842ff2c 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -155,8 +155,8 @@ jobs: - name: Check package build run: | - DISTRIBUTION=$(ls -t1 dist/openff-nagl-*.tar.gz | head -n 1) - test -n "${DISTRIBUTION}" || { echo "no distribution dist/openff-nagl-*.tar.gz found"; exit 1; } + DISTRIBUTION=$(ls -t1 dist/openff_nagl-*.tar.gz | head -n 1) + test -n "${DISTRIBUTION}" || { echo "no distribution dist/openff_nagl-*.tar.gz found"; exit 1; } echo "twine check $DISTRIBUTION" twine check $DISTRIBUTION From 9be8de34f533a7ddfed9fcf781c970e5de6669b3 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 14 Jan 2025 14:42:20 -0600 Subject: [PATCH 8/8] Cleanup --- .pre-commit-config.yaml | 10 +++++----- setup.cfg | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91802490..ab82fc02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,16 +6,16 @@ exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: master + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: debug-statements - repo: https://github.com/timothycrosley/isort - rev: master + rev: 5.13.2 hooks: - id: isort - - repo: https://gitlab.com/pycqa/flake8 - rev: master + - repo: https://github.com/pycqa/flake8 + rev: 7.1.1 hooks: - - id: flake8 \ No newline at end of file + - id: flake8 diff --git a/setup.cfg b/setup.cfg index 6b3f0076..155eced1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,4 +14,5 @@ exclude = versioneer.py all-files = 1 source-dir = docs/ build-dir = docs/_build -warning-is-error = 1 \ No newline at end of file +warning-is-error = 1 +