From 81827a3593e016bf9256d7167642bf7455ba70a4 Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 15:41:47 -0600 Subject: [PATCH 1/2] Switch to pyproject exclusively trying to fix versioning on conda-forge --- pyproject.toml | 42 +++++++++++++++++++++++++++++++++--- setup.py | 58 -------------------------------------------------- 2 files changed, 39 insertions(+), 61 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 2758df1..c19b306 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,42 @@ [build-system] -requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +requires = ["setuptools>=61.2", "versioningit"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] -write_to = "grits/__version__.py" +[project] +name = "grits" +description = "A toolkit for working with coarse-grained systems" +readme = "README.md" +authors = [{name = "Jenny Fothergill", email = "jennyfothergill@boisestate.edu"}] +license= {text = "GPLv3"} +classifiers=[ + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] +urls = {Homepage = "https://github.com/cmelab/grits"} +requires-python = ">=3.8" +dynamic = ["version"] + +[tool.setuptools] +zip-safe = false +include-package-data = true +license-files = ["LICENSE"] + +[tool.setuptools.packages] +find = {namespaces = false} + +[tool.setuptools.package-data] +grits = ['"./compounds/*"'] + +[tool.versioningit] +default-version = "1+unknown" + +[tool.versioningit.format] +distance = "{base_version}+{distance}.{vcs}{rev}" +dirty = "{base_version}+{distance}.{vcs}{rev}.dirty" +distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty" + +[tool.versioningit.vcs] +method = "git" +match = ["*"] +default-tag = "0.0.0" diff --git a/setup.py b/setup.py deleted file mode 100644 index a762818..0000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -from codecs import open -from os import path - -from setuptools import find_packages, setup - -# Package meta-data. -NAME = "grits" -DESCRIPTION = "A toolkit for working with coarse-grained systems" -URL = "https://github.com/cmelab/grits" -EMAIL = "jennyfothergill@boisestate.edu" -AUTHOR = "Jenny Fothergill" -REQUIRES_PYTHON = ">=3.8" - -# What packages are required for this module to be executed? -REQUIRED = [] - -here = path.abspath(path.dirname(__file__)) - -with open("README.md", "r", encoding="utf-8") as f: - long_description = f.read() - - -def myversion(): - from setuptools_scm.version import get_local_dirty_tag - - def clean_scheme(version): - return get_local_dirty_tag(version) if version.dirty else "+clean" - - return {"local_scheme": clean_scheme} - - -setup( - name=NAME, - use_scm_version=myversion, - author=AUTHOR, - author_email=EMAIL, - description=DESCRIPTION, - long_description=long_description, - long_description_content_type="text/markdown", - url=URL, - license="GPLv3", - project_urls={ - "Bug Tracker": f"{URL}/issues", - }, - python_requires=REQUIRES_PYTHON, - packages=find_packages(exclude=("tests", "docs", "examples")), - package_data={"grits": ["compounds/*"]}, - install_requires=REQUIRED, - include_package_data=True, - classifiers=[ - # Trove classifiers - # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - ], -) From b428541d97a7cc4ced3912d15cfcadd796c8960c Mon Sep 17 00:00:00 2001 From: Jenny Fothergill Date: Fri, 3 May 2024 15:57:05 -0600 Subject: [PATCH 2/2] Update install instructions --- README.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6be2c41..94f006e 100644 --- a/README.md +++ b/README.md @@ -12,29 +12,21 @@ GRiTS is a toolkit for working with coarse-grain systems. It uses [mBuild](https ### Installation #### Using a container -To use GRiTS in a prebuilt container (using [Singularity](https://singularity.lbl.gov/)), run: +To use GRiTS in a prebuilt container (using [Apptainer](https://apptainer.org/)), run: ```bash -singularity pull docker://ghcr.io/cmelab/grits:0.4.1 -singularity exec grits_0.4.1.sif bash +apptainer pull docker://ghcr.io/cmelab/grits:latest +apptainer run grits_latest.sif python ``` **Or** using [Docker](https://docs.docker.com/), run: ```bash -docker pull ghcr.io/cmelab/grits:0.4.1 -docker run -it cmelab/grits:0.4.1 +docker pull ghcr.io/cmelab/grits:latest +docker run -it cmelab/grits:latest ``` -#### Custom install +#### Micromamba install To create a local environment with [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)), run: ```bash -micromamba create -f environment.yml +micromamba create grits -f environment.yml micromamba activate grits ``` -With the `grits` environment active, install the package with pip: -``` -pip install . -``` -And to test your installation, run: -``` -pytest -```