From a71c2f840e22d23e3afe92d854cc35e313f8fb7f Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Mon, 30 Jan 2023 14:17:12 +0000 Subject: [PATCH 1/7] Bump setuptools and test editable installs --- .github/workflows/testing.yml | 3 +-- README.md | 4 ++-- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 9f79306..0c92d74 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -22,8 +22,7 @@ jobs: - name: Install dependencies & package run: | python -m pip install --upgrade pip - pip install .[strict,tests,dev] - pip install . + pip install -e .[strict,tests,dev] - name: Lint run: | diff --git a/README.md b/README.md index 9a331fb..a83870d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ This is an example add-on package for [atomate2](https://github.com/materialsproject/atomate2). -It is heavily based on -the equivalent [add-on template for pymatgen](https://github.com/materialsproject/pymatgen-addon-template). +It is heavily based on the equivalent +[add-on template for pymatgen](https://github.com/materialsproject/pymatgen-addon-template). ## License diff --git a/pyproject.toml b/pyproject.toml index 0a90898..f411736 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 42", "versioningit ~= 1.0", "wheel"] +requires = ["setuptools >= 62", "versioningit ~= 1.0", "wheel"] build-backend = "setuptools.build_meta" [tools.setuptools] From c51d2e1cc6fb2519da5dcac4817f8fb787d7ee82 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Mon, 30 Jan 2023 14:32:32 +0000 Subject: [PATCH 2/7] Bump isort in pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 997002b..eaa3dd4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: additional_dependencies: [black] exclude: README.md - repo: https://github.com/pycqa/isort - rev: 5.11.4 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/pycqa/flake8 From 91ae2d2dfac9c961d2e55a15afb92c47124e88e3 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Mon, 30 Jan 2023 14:55:30 +0000 Subject: [PATCH 3/7] Force bump setuptools --- .github/workflows/testing.yml | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0c92d74..978b56b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -21,7 +21,8 @@ jobs: - name: Install dependencies & package run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools + pip freeze pip install -e .[strict,tests,dev] - name: Lint diff --git a/pyproject.toml b/pyproject.toml index f411736..2dd59b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 62", "versioningit ~= 1.0", "wheel"] +requires = ["setuptools >= 66", "versioningit ~= 1.0", "wheel"] build-backend = "setuptools.build_meta" [tools.setuptools] From da073fed76870615a72ca36453d5aed611838b2e Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Mon, 30 Jan 2023 14:59:20 +0000 Subject: [PATCH 4/7] Only run actions on pushes to main, not all branches --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 978b56b..ab9e513 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -2,6 +2,7 @@ name: testing on: push: + branches: [main] pull_request: branches: [main] From 9f66cdc3d2ab11da8dd6129d15b5e0de6a7d49d7 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Mon, 30 Jan 2023 15:55:57 +0000 Subject: [PATCH 5/7] Test with flit --- pyproject.toml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2dd59b2..9112e02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,9 @@ [build-system] -requires = ["setuptools >= 66", "versioningit ~= 1.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["flit_core >=3.2,<4", "versioningit ~= 1.0", "wheel"] +build-backend = "flit_core.buildapi" -[tools.setuptools] -packages = ["atomate2.myaddon"] -[tools.setuptools.find] -where = ["src"] +[tool.flit.module] +name = "atomate2.myaddon" [project] name = "atomate2-myaddon" From 9c7a308de9efd339590d0abe70f033d4d21e380c Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Tue, 31 Jan 2023 09:14:48 +0000 Subject: [PATCH 6/7] Attempt to use hatch-vcs plugin --- pyproject.toml | 17 ++++++++++------- src/atomate2/myaddon/__init__.py | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9112e02..ba4a495 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,12 @@ [build-system] -requires = ["flit_core >=3.2,<4", "versioningit ~= 1.0", "wheel"] -build-backend = "flit_core.buildapi" +requires = ["hatchling", "hatch-vcs >= 0.3.0"] +build-backend = "hatchling.build" -[tool.flit.module] -name = "atomate2.myaddon" +[tool.hatch.version] +path = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "_version.py" [project] name = "atomate2-myaddon" @@ -40,9 +43,9 @@ strict = ["atomate2[strict]"] [project.urls] repository = "https://github.com/matgenix/atomate2-addon-template" -[tool.versioningit.vcs] -method = "git" -default-tag = "0.0.1" +#[tool.versioningit.vcs] +#method = "git" +#default-tag = "0.0.1" [tool.isort] profile = "black" diff --git a/src/atomate2/myaddon/__init__.py b/src/atomate2/myaddon/__init__.py index e69de29..754b350 100644 --- a/src/atomate2/myaddon/__init__.py +++ b/src/atomate2/myaddon/__init__.py @@ -0,0 +1 @@ +from atomate2.myaddon._version import __version__ From fd76fee8cf4c17cd9b683d315ab8afd1f994bdd9 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Tue, 7 Mar 2023 10:43:24 +0000 Subject: [PATCH 7/7] Fix hatch-vcs usage --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ba4a495..fb2dce4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling", "hatch-vcs >= 0.3.0"] build-backend = "hatchling.build" [tool.hatch.version] -path = "vcs" +source = "vcs" [tool.hatch.build.hooks.vcs] version-file = "_version.py" @@ -43,10 +43,6 @@ strict = ["atomate2[strict]"] [project.urls] repository = "https://github.com/matgenix/atomate2-addon-template" -#[tool.versioningit.vcs] -#method = "git" -#default-tag = "0.0.1" - [tool.isort] profile = "black"