Skip to content

Commit

Permalink
Merge pull request #506 from SPF-OST/remove-setuptools-git-versioning
Browse files Browse the repository at this point in the history
Don't depend on `setuptools-git-versioning` to get SHA of `pytrnsys` …
  • Loading branch information
zuckerruebe authored Apr 11, 2024
2 parents 4bed07d + b198094 commit 6e46936
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 68 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ jobs:
- name: Create virtual environment
run: py -3.12 -m venv venv

- name: Compute pytrnsys git SHA
id: sha
run: |
$pytrnsys_sha=$(venv\Scripts\python release\getPytrnsysMasterGitSha.py)
echo "pytrnsys_sha=${pytrnsys_sha}" >> $env:GITHUB_OUTPUT
- name: Install dependencies
run: |
venv\Scripts\python -m pip install --upgrade pip
venv\Scripts\python -m pip install wheel
venv\Scripts\python -m pip install -r requirements/test.txt
venv\Scripts\python -m pip install -r requirements/release.txt
- name: Build executable
run: venv\Scripts\python dev-tools/devTools.py -r
Expand All @@ -45,9 +51,8 @@ jobs:
id: fn
run: |
$pytrnsys_gui_sha=$(git rev-parse --short HEAD)
$pytrnsys_sha=$(release\build\pytrnsys\python-3.12.1-embed-amd64\python.exe release\getInstalledPytrnsysGitSha.py)
$ref_name="${{github.ref_name}}".replace("/","-")
echo "file_name_base=pytrnsys-gui-${ref_name}-${pytrnsys_gui_sha}-${pytrnsys_sha}" >> $env:GITHUB_OUTPUT
echo "file_name_base=pytrnsys-gui-${ref_name}-${pytrnsys_gui_sha}-${{steps.sha.outputs.pytrnsys_sha}}" >> $env:GITHUB_OUTPUT
- if: env.TAG_PUSH_TO_MASTER == 'true' || env.NORMAL_PUSH_TO_MASTER == 'true'
name: Create zip file
Expand Down
17 changes: 0 additions & 17 deletions release/getInstalledPytrnsysGitSha.py

This file was deleted.

13 changes: 13 additions & 0 deletions release/getPytrnsysMasterGitSha.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import subprocess as _sp


def main() -> None:
command = "git ls-remote https://github.com/SPF-OST/pytrnsys.git master".split()
completedProcess = _sp.run(command, check=True, capture_output=True, text=True)
longSha, _ = completedProcess.stdout.split()
shortenedSha = longSha[0:7]
print(shortenedSha, end="")


if __name__ == "__main__":
main()
4 changes: 0 additions & 4 deletions requirements/dev-3rd-party.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
-r test-3rd-party.in

setuptools-git-versioning

twine

pip-compile-multi

pre-commit
Expand Down
47 changes: 4 additions & 43 deletions requirements/dev-3rd-party.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:c9d8c177ed2d0b36deb3a30d3f962044a32cb836
# SHA1:0494bc643d8806279987601708ce67dbc0e4d9bf
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -21,9 +21,7 @@ charset-normalizer==3.3.2
distlib==0.3.7
# via virtualenv
docutils==0.20.1
# via
# readme-renderer
# sphinx
# via sphinx
filelock==3.13.1
# via virtualenv
identify==2.5.33
Expand All @@ -32,51 +30,20 @@ idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==7.0.1
# via twine
jaraco-classes==3.3.0
# via keyring
keyring==24.3.0
# via twine
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.1.0
# via jaraco-classes
nh3==0.2.15
# via readme-renderer
nodeenv==1.8.0
# via pre-commit
pip-compile-multi==2.6.3
# via -r requirements\dev-3rd-party.in
pip-tools==7.3.0
# via pip-compile-multi
pkginfo==1.9.6
# via twine
pre-commit==3.6.0
# via -r requirements\dev-3rd-party.in
pyproject-hooks==1.0.0
# via build
pywin32-ctypes==0.2.2
# via keyring
readme-renderer==42.0
# via twine
reloadium==1.3.3
# via -r requirements\dev-3rd-party.in
requests==2.31.0
# via
# requests-toolbelt
# sphinx
# twine
requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==13.7.0
# via twine
setuptools-git-versioning==1.13.5
# via -r requirements\dev-3rd-party.in
# via sphinx
snowballstemmer==2.2.0
# via sphinx
sphinx==7.2.6
Expand All @@ -101,16 +68,10 @@ sphinxcontrib-serializinghtml==1.1.9
# via sphinx
toposort==1.10
# via pip-compile-multi
twine==4.0.2
# via -r requirements\dev-3rd-party.in
urllib3==2.1.0
# via
# requests
# twine
# via requests
virtualenv==20.25.0
# via pre-commit
zipp==3.17.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ def _getInstallRequirements():
},
data_files=_getDataFilePairs(),
install_requires=_getInstallRequirements(),
setup_requires=["setuptools-git-versioning"],
python_requires=">=3.12",
)

0 comments on commit 6e46936

Please sign in to comment.