FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix cache issue with the build workflow by delatrie · Pull Request #810 · allure-framework/allure-python · GitHub

Fix cache issue with the build workflow - #810

Merged
delatrie merged 1 commit into
masterfrom
ci-cache-fix
Apr 18, 2024
Merged

Fix cache issue with the build workflow#810
delatrie merged 1 commit into
masterfrom
ci-cache-fix

Conversation

delatrie commented Apr 18, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Context

Starting from version 69.3.0, Setuptools canonicalizes filenames of a source distribution according to PEP 625. Notably, all hyphens (-) are replaced with underscores (_) in the distribution name.

That leads to the following error when installing previously built common packages during a testing job of the build workflow:

Run pip install dist/allure-python-commons*.tar.gz \
WARNING: Requirement 'dist/allure-python-commons*.tar.gz' looks like a filename, but the file does not exist
Processing ./dist/allure-python-commons*.tar.gz
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/runner/work/allure-python/allure-python/dist/allure-python-commons*.tar.gz'

If we run ls dist before pip install, we see the following content:

allure_python_commons-0.1.dev1+g2070930-py3-none-any.whl
allure_python_commons-0.1.dev1+g2070930.tar.gz
allure_python_commons_test-0.1.dev1+g2070930-py3-none-any.whl
allure_python_commons_test-0.1.dev1+g2070930.tar.gz

Although a simple fix of the pip install command would be enough, I've decided to eliminate caching altogether and replace it with direct installation from the corresponding directory. The caching doesn't save us anything:

PS > python -m venv env && ./env/bin/Activate.ps1 &&  measure-command { pip install ./dist/allure_python_commons-2.13.6.dev1+gf185ccc.tar.gz }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 11
Milliseconds      : 705
Ticks             : 117050592
TotalDays         : 0.000135475222222222
TotalHours        : 0.00325140533333333
TotalMinutes      : 0.19508432
TotalSeconds      : 11.7050592
TotalMilliseconds : 11705.0592

PS > rm -rf env && python -m venv env && ./env/bin/Activate.ps1 && measure-command { pip install ./allure-python-commons }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 10
Milliseconds      : 378
Ticks             : 103782877
TotalDays         : 0.000120119070601852
TotalHours        : 0.00288285769444444
TotalMinutes      : 0.172971461666667
TotalSeconds      : 10.3782877
TotalMilliseconds : 10378.2877

In fact, it only makes the build longer and more complicated.

delatrie added the type:internal Change that isn't visible or obvious for end users label Apr 18, 2024
  - remove build & cache of commons (install from dirs instead)
  - fix install packages command
delatrie requested a review from skhomuti April 18, 2024 16:52
delatrie self-assigned this Apr 18, 2024
delatrie marked this pull request as ready for review April 18, 2024 16:52
delatrie merged commit cdae0ba into master Apr 18, 2024
delatrie deleted the ci-cache-fix branch April 18, 2024 18:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:internal Change that isn't visible or obvious for end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL