Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[poetry-core] self-tests are sensitive to SOURCE_DATE_EPOCH #10011

Open
stanislavlevin opened this issue Jan 10, 2025 · 0 comments · May be fixed by python-poetry/poetry-core#816
Open

[poetry-core] self-tests are sensitive to SOURCE_DATE_EPOCH #10011

stanislavlevin opened this issue Jan 10, 2025 · 0 comments · May be fixed by python-poetry/poetry-core#816
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) area/core Related to the poetry-core library kind/bug Something isn't working as expected

Comments

@stanislavlevin
Copy link

Description

Running poetry-core's self-tests during RPM packaging for a Linux distro.
SOURCE_DATE_EPOCH env variable is set in such build environment. This leads to tests failures.

export SOURCE_DATE_EPOCH=1736507118
python3 -m pytest tests
...

FAILED tests/masonry/builders/test_sdist.py::test_sdist_mtime_zero - AssertionError: assert 1736507118 == 0
FAILED tests/masonry/builders/test_sdist.py::test_sdist_members_mtime_default[20] - AssertionError: assert 1736507118 == 0
FAILED tests/masonry/builders/test_sdist.py::test_sdist_members_mtime_default[10] - AssertionError: assert 1736507118 == 0
FAILED tests/masonry/builders/test_wheel.py::test_dist_info_date_time_default_value[20] - assert (2025, 1, 10, 11, 5, 18) == (2016, 1, 1, 0, 0, 0)
FAILED tests/masonry/builders/test_wheel.py::test_dist_info_date_time_default_value[10] - assert (2025, 1, 10, 11, 5, 18) == (2016, 1, 1, 0, 0, 0)

Workarounds

Unset SOURCE_DATE_EPOCH for tests.

Poetry Installation Method

other

Operating System

ALTLinux (sisyphus)

Poetry Version

poetry-core 2.0.0

Poetry Configuration

No poetry configuration.

Python Sysconfig

sysconfig.log
Paste the output of 'python -m sysconfig', over this line.

Example pyproject.toml

No response

Poetry Runtime Logs

No poetry runtime logs.

@stanislavlevin stanislavlevin added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 10, 2025
@abn abn added area/build-system Related to PEP 517 packaging (see poetry-core) kind/feature Feature requests/implementations area/core Related to the poetry-core library and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 10, 2025
@Secrus Secrus added kind/bug Something isn't working as expected and removed kind/feature Feature requests/implementations labels Jan 12, 2025
abn added a commit to abn/poetry-core that referenced this issue Jan 17, 2025
Resolves: python-poetry/poetry#10011

fix(tests): clear SOURCE_DATE_EPOC from env if set
abn added a commit to abn/poetry-core that referenced this issue Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) area/core Related to the poetry-core library kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants