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

Version checking with importlib and versioneer config update #1048

Merged
merged 9 commits into from Oct 24, 2022

Conversation

Raalsky
Copy link
Contributor

@Raalsky Raalsky commented Oct 19, 2022

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 19, 2022

Test Results

    2 files  +    1      2 suites  +1   1m 39s ⏱️ - 16m 57s
481 tests +242  481 ✔️ +246  0 💤  - 3  0  - 1 
962 runs  +723  962 ✔️ +727  0 💤  - 3  0  - 1 

Results for commit 9985db8. ± Comparison against base commit 92e96c5.

This pull request removes 239 and adds 481 tests. Note that renamed tests count towards both.
management.test_management.TestManagement ‑ test_create_project
management.test_management.TestManagement ‑ test_invite_as_non_admin
management.test_management.TestManagement ‑ test_standard_scenario
management.test_management.TestManagement ‑ test_visibility_workspace
management.test_management.TestTrashObjects ‑ test_trash_model_version
management.test_management.TestTrashObjects ‑ test_trash_runs_and_models
standard.test_artifacts.TestArtifacts ‑ test_assignment[model]
standard.test_artifacts.TestArtifacts ‑ test_assignment[model_version]
standard.test_artifacts.TestArtifacts ‑ test_assignment[project]
standard.test_artifacts.TestArtifacts ‑ test_assignment[run]
…
tests.neptune.alpha_integration.test_alpha_integration_backend.TestAlphaIntegrationNeptuneBackend ‑ test_send_channels_image_values
tests.neptune.alpha_integration.test_alpha_integration_backend.TestAlphaIntegrationNeptuneBackend ‑ test_send_channels_numeric_values
tests.neptune.alpha_integration.test_alpha_integration_backend.TestAlphaIntegrationNeptuneBackend ‑ test_send_channels_text_values
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_cannot_resolve_host
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_deprecated_token
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_max_compatible_version_fail
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_max_compatible_version_ok
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_min_compatible_version_fail
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_min_compatible_version_ok
tests.neptune.legacy.internal.backends.test_hosted_neptune_backend.TestHostedNeptuneBackend ‑ test_should_accept_given_api_token
…

♻️ This comment has been updated with latest results.

@Raalsky Raalsky changed the title Bravado monkey patch Version checking with importlib and versioneer config update Oct 19, 2022

try:
__version__ = version("neptune-client")
except PackageNotFoundError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is possible catch PackageNotFoundError when python has the src/neptune/version.py in path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importlib.metdata.version("something") works similarly to pip list | grep something instead of checking the current namespace.
For instance typing is a proper builtin package but:

>>> import typing
>>> importlib.metadata.version("typing")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/neptune/.conda/envs/neptune-client/lib/python3.10/importlib/metadata/__init__.py", line 984, in version
    return distribution(distribution_name).version
  File "/Users/neptune/.conda/envs/neptune-client/lib/python3.10/importlib/metadata/__init__.py", line 957, in distribution
    return Distribution.from_name(distribution_name)
  File "/Users/neptune/.conda/envs/neptune-client/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for typing

so I think that nothing will impact it except pip install neptune-client or pip install -e . or pip install . (including direct call to python setup.py install)

@Raalsky Raalsky merged commit 29f21df into master Oct 24, 2022
@Raalsky Raalsky deleted the rj/bravado-patch branch October 24, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants