Project

Profile

Help

Story #7624

Add pulpcore version to the plugin API

Added by dalley 2 months ago. Updated about 1 month ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

<alikins> in the plugin api, is there an equilivent to `from pulpcore import __version__ as pulp_version`  to get the pulpcore version?
<alikins> idealy without invoking 'packaging' or 'distsetutools' etc
* x9c4 has quit (Quit: Leaving)
<dkliban> alikins: https://github.com/pulp/pulpcore/blob/master/pulpcore/__init__.py#L1
<dkliban> like that?
<dkliban> it's not part of the plugin api though

NOTE: It likely affects the release automation, make sure to update that.


Related issues

Related to Pulp - Story #6671: As a pulpcore developer I can reliably determine the version of a Django pluginPOST

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision b3af3ad5 View on GitHub
Added by dalley 2 months ago

Expose pulpcore_version to plugin writers

Give plugin writers a way to access the pulpcore version. This is possiblyuseful in case they want to support more than one version of the plugin API at the same time.

closes: #7624 https://pulp.plan.io/issues/7624

History

#1 Updated by dalley 2 months ago

  • Status changed from ASSIGNED to MODIFIED

#2 Updated by lmjachky 2 months ago

After this change, I am receiving errors while initializing my vagrant box (pulp3-source-fedora31).

pulp_rpm on the master branch:

Traceback (most recent call last):
  File "/usr/local/lib/pulp/bin/django-admin", line 8, in <module>
    sys.exit(execute_from_command_line())
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/vagrant/devel/pulp_rpm/pulp_rpm/app/__init__.py", line 1, in <module>
    from pulpcore.plugin import PulpPluginAppConfig
  File "/home/vagrant/devel/pulpcore/pulpcore/plugin/__init__.py", line 5, in <module>
    from pulpcore import __version__ as pulpcore_version  # noqa
ImportError: cannot import name '__version__' from 'pulpcore' (/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/__init__.py)

pulp_container on the master branch:

Traceback (most recent call last):
  File "/usr/local/lib/pulp/bin/django-admin", line 8, in <module>
    sys.exit(execute_from_command_line())
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/vagrant/devel/pulp_container/pulp_container/app/__init__.py", line 1, in <module>
    from pulpcore.plugin import PulpPluginAppConfig
  File "/home/vagrant/devel/pulpcore/pulpcore/plugin/__init__.py", line 5, in <module>
    from pulpcore import __version__ as pulpcore_version  # noqa
ImportError: cannot import name '__version__' from 'pulpcore' (/usr/local/lib/pulp/lib64/python3.7/site-packages/pulpcore/__init__.py)

Are there required any modifications from the plugin writer's perspective?

#3 Updated by lmjachky 2 months ago

I believe, the answer to my question is Yes. Even though it is somehow said in the changelog entry (Added a constant holding the pulpcore version which can be imported by plugins - pulpcore.plugin.pulpcore_version), it could be announced globally at pulp-dev.

#4 Updated by ttereshc about 2 months ago

  • Sprint/Milestone set to 3.8.0

#5 Updated by ttereshc about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

#6 Updated by dalley about 1 month ago

  • Status changed from CLOSED - CURRENTRELEASE to NEW
  • Assignee deleted (dalley)
  • Sprint/Milestone deleted (3.8.0)

This was merged and then reverted

#7 Updated by ttereshc about 1 month ago

  • Tracker changed from Issue to Story
  • % Done set to 0
  • Severity deleted (2. Medium)
  • Triaged deleted (No)

#8 Updated by bmbouter about 1 month ago

  • Related to Story #6671: As a pulpcore developer I can reliably determine the version of a Django plugin added

#9 Updated by ttereshc about 1 month ago

  • Description updated (diff)

#10 Updated by bmbouter about 1 month ago

  • Status changed from NEW to CLOSED - DUPLICATE

Please register to edit this issue

Also available in: Atom PDF