release-engineering / pubtools-pulplib

A Pulp library for publishing tools
GNU General Public License v3.0
2 stars 24 forks source link

Use time.monotonic on py3.3+ #194

Closed MichalHaluza closed 1 year ago

MichalHaluza commented 1 year ago

On Python 3.3 or newer, monotonic module aliases time.monotonic from the standard library. On older versions, it will fall back to an equivalent platform specific implementation provided by the monotonic module. This is reflected also in requirements.txt

codecov[bot] commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (05b2cd7) compared to base (caa383a). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #194 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 48 48 Lines 2968 2969 +1 ========================================= + Hits 2968 2969 +1 ``` | [Impacted Files](https://codecov.io/gh/release-engineering/pubtools-pulplib/pull/194?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering) | Coverage Δ | | |---|---|---| | [pubtools/pulplib/\_impl/log.py](https://codecov.io/gh/release-engineering/pubtools-pulplib/pull/194/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering#diff-cHVidG9vbHMvcHVscGxpYi9faW1wbC9sb2cucHk=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

MichalHaluza commented 1 year ago

@rohanpm: Is there anything I can do with the No module named 'monotonic' reported by pidiff? The module name is correct and the commit shouldn't be treated as an API change. Not to mention that the module has been imported and used until now, I just added it as an explicit requirement.

rohanpm commented 1 year ago

@rohanpm: Is there anything I can do with the No module named 'monotonic' reported by pidiff? The module name is correct and the commit shouldn't be treated as an API change. Not to mention that the module has been imported and used until now, I just added it as an explicit requirement.

The problem here seems to be:

In other words, the latest more-executors release caused installation of the latest pubtools-pulplib from pypi to become broken, and pidiff is just accurately reflecting that. The broken package can reproduce at the command-line, with the pubtools-pulplib currently on pypi today:

$ virtualenv ~/dev/clean-venv
...

$ ~/dev/clean-venv/bin/pip install pubtools-pulplib
...

$ ~/dev/clean-venv/bin/python -c 'import pubtools.pulplib'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/rmcgover/dev/clean-venv/lib64/python3.10/site-packages/pubtools/pulplib/__init__.py", line 1, in <module>
    from ._impl.client import Client, PulpException, TaskFailedException, CopyOptions
  File "/home/rmcgover/dev/clean-venv/lib64/python3.10/site-packages/pubtools/pulplib/_impl/client/__init__.py", line 1, in <module>
    from .client import Client, CopyOptions
  File "/home/rmcgover/dev/clean-venv/lib64/python3.10/site-packages/pubtools/pulplib/_impl/client/client.py", line 26, in <module>
    from ..log import TimedLogger
  File "/home/rmcgover/dev/clean-venv/lib64/python3.10/site-packages/pubtools/pulplib/_impl/log.py", line 3, in <module>
    from monotonic import monotonic
ModuleNotFoundError: No module named 'monotonic'

Of course, we need to release a new pubtools-pulplib to fix this. The most practical thing seems to be to ignore this specific CI failure. Also if there are any tools which can verify that a library properly declares all its dependencies and doesn't rely on any of them being pulled in transitively, it would be good to adopt them...