diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index fe3ae8e4..e842ff2c 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -150,12 +150,13 @@ jobs: - name: Build package run: | - python setup.py sdist + python3 -m pip install --upgrade build + python3 -m build - 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 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/.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/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/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 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..66ee824f --- /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..155eced1 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,14 @@ 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 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", - ] - } -)