-
-
Notifications
You must be signed in to change notification settings - Fork 15
Remove use of pkg_resources for importlib.metadata #104
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
b57b29b
a5f564e
5cbdccc
9ec71c5
fd822c8
f8be9be
038f965
22bdf86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ jobs: | |
| - name: Set up Python | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: "3.9" | ||
| python-version: "3.11" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if there would be a "latest" or "latest-1" flag or so, such that this has not to be manually adjusted every now and then. (Nothing to do with this PR though.) |
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -278,23 +278,7 @@ else: | |
| A couple of locations are checked, and we are happy to implement more if | ||
| needed, just open an issue! | ||
|
Comment on lines
278
to
279
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This could potentially also be removed. |
||
|
|
||
| Currently, it looks in the following places: | ||
| - `__version__` | ||
| - `version` | ||
| - lookup `VERSION_ATTRIBUTES` in the scooby knowledge base | ||
| - lookup `VERSION_METHODS` in the scooby knowledge base | ||
|
|
||
| `VERSION_ATTRIBUTES` is a dictionary of attributes for known python packages | ||
| with a non-standard place for the version, e.g. `VERSION_ATTRIBUTES['vtk'] = | ||
| 'VTK_VERSION'`. You can add other known places via: | ||
|
|
||
| ```py | ||
| scooby.knowledge.VERSION_ATTRIBUTES['a_module'] = 'Awesome_version_location' | ||
| ``` | ||
|
|
||
| Similarly, `VERSION_METHODS` is a dictionary for methods to retrieve the | ||
| version, and you can similarly add your methods which will get the version | ||
| of a package. | ||
| Currently, it uses `importlib.metadata.version` to get the distribution version. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the entire section could be removed. Anyway, it is funny, as it will shift the focus of scooby. A big part of scooby was to find the version number in all potential odd situation. Which was sort of the detective part. Now, using importlib, scooby sort of (at least for the versions) is merely a display tool. Which is not a bad thing at all, but it is interesting to see where the whole thing came from and where it goes. |
||
|
|
||
| ### Using scooby to get version information. | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following lines will potentially have to be adjusted: |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there would be a "supported" or "official" flag or so, such that this has not to be manually adjusted every now and then. (Nothing to do with this PR though.)