From 0ac7443fbc8cb7db4b21c52f83ca9a47f5f83741 Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 10 Aug 2023 21:01:40 -0500 Subject: [PATCH 1/4] REF move to the modern system --- .git_archival.txt | 4 +++ .gitattributes | 1 + .github/workflows/tests.yml | 28 ++++++++++++++- .gitignore | 1 + MANIFEST.in | 3 ++ .../_version.py | 1 - pyproject.toml | 36 +++++++++++++++++++ setup.py | 19 ++-------- 8 files changed, 74 insertions(+), 19 deletions(-) create mode 100644 .git_archival.txt create mode 100644 .gitattributes create mode 100644 MANIFEST.in delete mode 100644 conda_forge_feedstock_check_solvable/_version.py create mode 100644 pyproject.toml diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000..3994ec0 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..00a7b00 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b2f92dd..e8bb3c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,6 +15,8 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: conda-incubator/setup-miniconda@v2 with: @@ -30,7 +32,7 @@ jobs: shell: bash -l {0} run: | mamba install --yes --file=requirements.txt - mamba install --yes pytest flake8 flaky pip + mamba install --yes pytest flake8 flaky pip python-build setuptools_scm>=7 setuptools>=45 toml pip install -e . - name: lint @@ -38,6 +40,30 @@ jobs: run: | flake8 conda_forge_feedstock_check_solvable + - name: test versions + shell: bash -el {0} + run: | + pip uninstall conda-forge-feedstock-check-solvable --yes + [[ $(python setup.py --version) != "0.0.0" ]] || exit 1 + + rm -rf dist/* + python setup.py sdist + pip install --no-deps --no-build-isolation dist/*.tar.gz + pushd .. + python -c "import conda_forge_feedstock_check_solvable; assert conda_forge_feedstock_check_solvable.__version__ != '0.0.0'" + popd + pip uninstall conda-forge-feedstock-check-solvable --yes + + rm -rf dist/* + python -m build --sdist . --outdir dist + pip install --no-deps --no-build-isolation dist/*.tar.gz + pushd .. + python -c "import conda_forge_feedstock_check_solvable; assert conda_forge_feedstock_check_solvable.__version__ != '0.0.0'" + popd + pip uninstall conda-forge-feedstock-check-solvable --yes + + python -m pip install -v --no-deps --no-build-isolation -e . + - name: test shell: bash -l {0} run: | diff --git a/.gitignore b/.gitignore index 59cdcc5..7c0e32b 100644 --- a/.gitignore +++ b/.gitignore @@ -129,3 +129,4 @@ dmypy.json .pyre/ conda_forge_feedstock_check_solvable.egg-info/ +conda_forge_feedstock_check_solvable/_version.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..74cb882 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include conda-forge-feedstock-check-solvable/_version.py +include requirements.txt +include LICENSE diff --git a/conda_forge_feedstock_check_solvable/_version.py b/conda_forge_feedstock_check_solvable/_version.py deleted file mode 100644 index f9aa3e1..0000000 --- a/conda_forge_feedstock_check_solvable/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.3.2" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..709c9b9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[build-system] +requires = [ + "setuptools>=45", + "setuptools_scm>=7", + "tomli>=1.0.0; python_version < '3.11'", +] +build-backend = "setuptools.build_meta" + +[project] +name = "conda-forge-feedstock-check-solvable" +authors = [ + {name = "conda-forge-tick development team", email = "condaforge@gmail.com"}, +] +description = "A mamba-based package to check if a conda-forge feedstock is solvable." +dynamic = ["version", "dependencies"] +license = {file = "LICENSE"} +readme = "README.md" + +[project.urls] +home = "https://github.com/regro/conda-forge-feedstock-check-solvable" + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools.packages.find] +exclude = ['tests'] + +[tool.setuptools_scm] +write_to = "conda_forge_feedstock_check-solvable/_version.py" +write_to_template = "__version__ = '{version}'\n" + +[tool.black] +line-length = 88 + +[tool.isort] +profile = "black" diff --git a/setup.py b/setup.py index f3c10c9..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,3 @@ -from setuptools import setup, find_packages +from setuptools import setup -__version__ = None -with open("conda_forge_feedstock_check_solvable/_version.py") as fp: - exec(fp.read().strip()) - -setup( - name="conda-forge-feedstock-check-solvable", - version=__version__, - description=( - "A mamba-based package to check if a " - "conda-forge feedstock is solvable." - ), - author="Conda-forge-tick Development Team", - author_email="", - url="https://github.com/regro/conda-forge-feedstock-check-solvable", - packages=find_packages(exclude=["tests"]), -) +setup() From d6d9c3e63239667283c9f3297e683b5a7b68f975 Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 10 Aug 2023 21:04:19 -0500 Subject: [PATCH 2/4] BUG wrong target --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 709c9b9..a27387e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = {file = ["requirements.txt"]} exclude = ['tests'] [tool.setuptools_scm] -write_to = "conda_forge_feedstock_check-solvable/_version.py" +write_to = "conda_forge_feedstock_check_solvable/_version.py" write_to_template = "__version__ = '{version}'\n" [tool.black] From c63fa602545063dfeb48f253e49709facb8638ab Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 10 Aug 2023 21:08:53 -0500 Subject: [PATCH 3/4] exclude tests again --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a27387e..87e12e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ home = "https://github.com/regro/conda-forge-feedstock-check-solvable" dependencies = {file = ["requirements.txt"]} [tool.setuptools.packages.find] -exclude = ['tests'] +exclude = ['tests*'] [tool.setuptools_scm] write_to = "conda_forge_feedstock_check_solvable/_version.py" From ce57c286424663bdb909592440ca5b61a3fa7478 Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 10 Aug 2023 21:17:42 -0500 Subject: [PATCH 4/4] try this one --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 74cb882..01560bf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include conda-forge-feedstock-check-solvable/_version.py include requirements.txt include LICENSE +recursive-exclude tests *