This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose package metadata from wheels in .par files (#49)
* Expose package metadata from wheels in .par files * Update pkg_resources's default distribution metadata object. `pkg_resources` creates a default WorkingSet as soon as it is imported, so even though we add hooks for it to find the .dist-info metadata inside .par files, it is too late. So we manually update the default WorkingSet, trying not to disturb existing entries. * Cut down unnecessary test data. * Fix lint errors
- Loading branch information
Douglas Greiman
authored
Nov 9, 2017
1 parent
556adf3
commit 051d7f6
Showing
16 changed files
with
299 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2017 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Integration test program for Subpar. | ||
Test that pkg_resources correctly identifies distribution packages | ||
inside a .par file. | ||
""" | ||
|
||
|
||
def main(): | ||
print('In pkg_resources test main()') | ||
try: | ||
import pkg_resources | ||
except ImportError: | ||
print('Skipping test, pkg_resources module is not available') | ||
return | ||
|
||
ws = pkg_resources.working_set | ||
|
||
# Informational for debugging | ||
distributions = list(ws) | ||
print('Resources found: %s' % distributions) | ||
|
||
# Check for the packages we provided metadata for. There will | ||
# also be metadata for whatever other packages happen to be | ||
# installed in the current Python interpreter. | ||
for spec in ['portpicker==1.2.0', 'yapf==0.19.0']: | ||
dist = ws.find(pkg_resources.Requirement.parse(spec)) | ||
assert dist, (spec, distributions) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
__main__.py | ||
pypi__portpicker_1_2_0/portpicker-1.2.0.dist-info/METADATA | ||
pypi__portpicker_1_2_0/portpicker-1.2.0.dist-info/metadata.json | ||
pypi__yapf_0_19_0/yapf-0.19.0.dist-info/METADATA | ||
pypi__yapf_0_19_0/yapf-0.19.0.dist-info/metadata.json | ||
subpar/__init__.py | ||
subpar/runtime/__init__.py | ||
subpar/runtime/support.py | ||
subpar/tests/__init__.py | ||
subpar/tests/package_pkg_resources/__init__.py | ||
subpar/tests/package_pkg_resources/main | ||
subpar/tests/package_pkg_resources/main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
__main__.py | ||
pypi__portpicker_1_2_0/portpicker-1.2.0.dist-info/METADATA | ||
pypi__portpicker_1_2_0/portpicker-1.2.0.dist-info/metadata.json | ||
pypi__yapf_0_19_0/yapf-0.19.0.dist-info/METADATA | ||
pypi__yapf_0_19_0/yapf-0.19.0.dist-info/metadata.json | ||
subpar/__init__.py | ||
subpar/runtime/__init__.py | ||
subpar/runtime/support.py | ||
subpar/tests/__init__.py | ||
subpar/tests/package_pkg_resources/__init__.py | ||
subpar/tests/package_pkg_resources/main | ||
subpar/tests/package_pkg_resources/main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Wheels | ||
|
||
This directory contains code, metadata files, and wheels, from other projects, | ||
used for testing. The projects were chosen to match the licence and ownership | ||
of this project, i.e. Apache License 2.0, copyright owned by Google, from the | ||
Google organization repository. Do not add any other type of thing here. | ||
|
||
- [python_portpicker](https://github.com/google/python_portpicker) | ||
- [yapf](https://github.com/google/yapf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Test package for Subpar | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
py_library( | ||
name = "files", | ||
srcs = [], | ||
data = glob(["portpicker-1.2.0.dist-info/**"]), | ||
imports = ["."], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
workspace(name = "pypi__portpicker_1_2_0") |
29 changes: 29 additions & 0 deletions
29
third_party/pypi__portpicker_1_2_0/portpicker-1.2.0.dist-info/METADATA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Metadata-Version: 2.0 | ||
Name: portpicker | ||
Version: 1.2.0 | ||
Summary: A library to choose unique available network ports. | ||
Home-page: https://github.com/google/python_portpicker | ||
Author: Google | ||
Author-email: [email protected] | ||
License: Apache 2.0 | ||
Description-Content-Type: UNKNOWN | ||
Platform: POSIX | ||
Classifier: Development Status :: 5 - Production/Stable | ||
Classifier: License :: OSI Approved :: Apache Software License | ||
Classifier: Intended Audience :: Developers | ||
Classifier: Programming Language :: Python | ||
Classifier: Programming Language :: Python :: 2 | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: Programming Language :: Python :: 3.3 | ||
Classifier: Programming Language :: Python :: 3.4 | ||
Classifier: Programming Language :: Python :: 3.5 | ||
Classifier: Programming Language :: Python :: 3.6 | ||
Classifier: Programming Language :: Python :: Implementation :: CPython | ||
Classifier: Programming Language :: Python :: Implementation :: Jython | ||
Classifier: Programming Language :: Python :: Implementation :: PyPy | ||
|
||
Portpicker provides an API to find and return an available network | ||
port for an application to bind to. Ideally suited for use from | ||
unittests or for test harnesses that launch local servers. | ||
|
1 change: 1 addition & 0 deletions
1
third_party/pypi__portpicker_1_2_0/portpicker-1.2.0.dist-info/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"classifiers": ["Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: Jython", "Programming Language :: Python :: Implementation :: PyPy"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"contacts": [{"email": "[email protected]", "name": "Google", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/google/python_portpicker"}}}, "generator": "bdist_wheel (0.30.0)", "license": "Apache 2.0", "metadata_version": "2.0", "name": "portpicker", "platform": "POSIX", "summary": "A library to choose unique available network ports.", "version": "1.2.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Test package for Subpar | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
py_library( | ||
name = "files", | ||
srcs = [], | ||
data = glob(["yapf-0.19.0.dist-info/**"]), | ||
imports = ["."], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
workspace(name = "pypi__yapf_0_19_0") |
24 changes: 24 additions & 0 deletions
24
third_party/pypi__yapf_0_19_0/yapf-0.19.0.dist-info/METADATA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Metadata-Version: 2.0 | ||
Name: yapf | ||
Version: 0.19.0 | ||
Summary: A formatter for Python code. | ||
Home-page: UNKNOWN | ||
Author: Bill Wendling | ||
Author-email: [email protected] | ||
License: Apache License, Version 2.0 | ||
Platform: UNKNOWN | ||
Classifier: Development Status :: 4 - Beta | ||
Classifier: Environment :: Console | ||
Classifier: Intended Audience :: Developers | ||
Classifier: License :: OSI Approved :: Apache Software License | ||
Classifier: Operating System :: OS Independent | ||
Classifier: Programming Language :: Python | ||
Classifier: Programming Language :: Python :: 2 | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: Programming Language :: Python :: 3.4 | ||
Classifier: Programming Language :: Python :: 3.5 | ||
Classifier: Topic :: Software Development :: Libraries :: Python Modules | ||
Classifier: Topic :: Software Development :: Quality Assurance | ||
|
||
Text from original package has been elided. |
1 change: 1 addition & 0 deletions
1
third_party/pypi__yapf_0_19_0/yapf-0.19.0.dist-info/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"classifiers": ["Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance"], "extensions": {"python.commands": {"wrap_console": {"yapf": "yapf:run_main"}}, "python.details": {"contacts": [{"email": "[email protected]", "name": "Bill Wendling", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}, "python.exports": {"console_scripts": {"yapf": "yapf:run_main"}}}, "generator": "bdist_wheel (0.29.0)", "license": "Apache License, Version 2.0", "metadata_version": "2.0", "name": "yapf", "summary": "A formatter for Python code.", "version": "0.19.0"} |