From dd3e6cb52fb567d838b9cd7ff79fb4ca0829ea1c Mon Sep 17 00:00:00 2001 From: Patrick O'Hara Date: Thu, 28 Mar 2024 12:19:38 +0000 Subject: [PATCH 1/2] Try to fix version upload --- .github/workflows/publish.yml | 2 ++ .gitignore | 3 ++- pyproject.toml | 3 ++- tspwplib/_version.py | 17 +++++++++++++++++ tspwplib/exception.py | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 tspwplib/_version.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6f017ce..1b2a229 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,6 +36,8 @@ jobs: - name: Install pypa/build run: python3 -m pip install build --user + - name: Check git works + run: git status - name: Build a binary wheel and a source tarball run: python3 -m build - name: Store the distribution packages diff --git a/.gitignore b/.gitignore index 7e07498..15c1061 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,8 @@ __pycache__ .DSStore .devcontainer cache -build +build/* +dist/* # docs site/ diff --git a/pyproject.toml b/pyproject.toml index f78c104..b8f0def 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ urls = {Code = "https://github.com/PatrickOHara/tspwplib", Documentation = "http description="Library of instances for TSP with Profits" readme = "README.md" requires-python = ">=3.10" -keywords = ["Distributionally Robust Optimisation"] +keywords = ["TSP"] license = {text = "MIT"} classifiers=[ "Programming Language :: Python", @@ -36,3 +36,4 @@ dynamic = ["version"] packages = ["tspwplib"] [tool.setuptools_scm] +version_file = "tspwplib/_version.py" diff --git a/tspwplib/_version.py b/tspwplib/_version.py new file mode 100644 index 0000000..4fd36d9 --- /dev/null +++ b/tspwplib/_version.py @@ -0,0 +1,17 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = "0.7.9.dev0+g3af79a1.d20240328" +__version_tuple__ = version_tuple = (0, 7, 9, "dev0", "g3af79a1.d20240328") diff --git a/tspwplib/exception.py b/tspwplib/exception.py index 597c172..2f0389b 100644 --- a/tspwplib/exception.py +++ b/tspwplib/exception.py @@ -24,7 +24,7 @@ class NotSimplePathException(NotSimpleException): class UnexpectedSelfLoopException(ex.NetworkXException): - """A self loop was found where it wasn't exprected""" + """A self loop was found where it wasn't expected""" class GraphStructureException(ex.NetworkXException): From 3a26c1e5e4640fdd00205f2ac4a5812ad8de9976 Mon Sep 17 00:00:00 2001 From: Patrick O'Hara Date: Thu, 28 Mar 2024 13:32:50 +0000 Subject: [PATCH 2/2] Ignore version file when formatting --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b8f0def..4b30e99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,3 +37,6 @@ packages = ["tspwplib"] [tool.setuptools_scm] version_file = "tspwplib/_version.py" + +[tool.black] +exclude = "_version.py"