Skip to content

Commit

Permalink
Revert to patching pyproject.toml for nightlies
Browse files Browse the repository at this point in the history
pypa/setuptools-scm#455 (comment)
turned out to be a bad idea and didn't work as expected.
  • Loading branch information
webknjaz committed Nov 8, 2022
1 parent d9c041c commit 42788c0
Showing 1 changed file with 63 additions and 21 deletions.
84 changes: 63 additions & 21 deletions .github/workflows/build-test-n-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,18 +500,32 @@ jobs:
&& github.event.inputs.release-commitish || ''
}}
- name: Write the current version metadata to `.git_archival.txt`
- name: Install tomlkit Python distribution package
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: >-
git show --format='node: %H%nnode-date: %cI%ndescribe-name:
%(describe:tags=true,match=*[0-9]*)%nref-names: %D%n' --no-patch
|
tee -a .git_archival.txt
- name: Delete the Git repository
python -m pip install --user tomlkit
- name: Instruct setuptools-scm not to add a local version part
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: |
from pathlib import Path
import tomlkit
pyproject_toml_path = Path.cwd() / 'pyproject.toml'
with pyproject_toml_path.open() as pyproject_toml_fp:
pyproject_toml = tomlkit.load(pyproject_toml_fp)
setuptools_scm_section = pyproject_toml['tool']['setuptools_scm']
setuptools_scm_section['local_scheme'] = 'no-local-version'
tomlkit.dump(pyproject_toml, pyproject_toml_fp)
shell: python
- name: Pretend that pyproject.toml is unchanged
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: rm -rf .git
run: |
git diff --color=always
git update-index --assume-unchanged pyproject.toml
- name: Build dist
run: >-
Expand Down Expand Up @@ -783,18 +797,32 @@ jobs:
&& github.event.inputs.release-commitish || ''
}}
- name: Write the current version metadata to `.git_archival.txt`
- name: Install tomlkit Python distribution package
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: >-
git show --format='node: %H%nnode-date: %cI%ndescribe-name:
%(describe:tags=true,match=*[0-9]*)%nref-names: %D%n' --no-patch
|
tee -a .git_archival.txt
- name: Delete the Git repository
python -m pip install --user tomlkit
- name: Instruct setuptools-scm not to add a local version part
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: rm -rf .git
run: |
from pathlib import Path
import tomlkit
pyproject_toml_path = Path.cwd() / 'pyproject.toml'
with pyproject_toml_path.open() as pyproject_toml_fp:
pyproject_toml = tomlkit.load(pyproject_toml_fp)
setuptools_scm_section = pyproject_toml['tool']['setuptools_scm']
setuptools_scm_section['local_scheme'] = 'no-local-version'
tomlkit.dump(pyproject_toml, pyproject_toml_fp)
shell: python
- name: Pretend that pyproject.toml is unchanged
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: |
git diff --color=always
git update-index --assume-unchanged pyproject.toml
- name: >-
Set up QEMU ${{ env.QEMU_ARCH }} arch emulation
Expand Down Expand Up @@ -966,18 +994,32 @@ jobs:
&& github.event.inputs.release-commitish || ''
}}
- name: Write the current version metadata to `.git_archival.txt`
- name: Install tomlkit Python distribution package
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: >-
git show --format='node: %H%nnode-date: %cI%ndescribe-name:
%(describe:tags=true,match=*[0-9]*)%nref-names: %D%n' --no-patch
|
tee -a .git_archival.txt
- name: Delete the Git repository
python -m pip install --user tomlkit
- name: Instruct setuptools-scm not to add a local version part
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: rm -rf .git
run: |
from pathlib import Path
import tomlkit
pyproject_toml_path = Path.cwd() / 'pyproject.toml'
with pyproject_toml_path.open() as pyproject_toml_fp:
pyproject_toml = tomlkit.load(pyproject_toml_fp)
setuptools_scm_section = pyproject_toml['tool']['setuptools_scm']
setuptools_scm_section['local_scheme'] = 'no-local-version'
tomlkit.dump(pyproject_toml, pyproject_toml_fp)
shell: python
- name: Pretend that pyproject.toml is unchanged
if: >-
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
run: |
git diff --color=always
git update-index --assume-unchanged pyproject.toml
- name: Build sdist and verify metadata
run: >-
Expand Down

0 comments on commit 42788c0

Please sign in to comment.