Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
14c82188
Commit
14c82188
authored
Oct 08, 2019
by
Benoit Pierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: drop pkg_resources tests dependency on easy_install
parent
7956986e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
46 deletions
+40
-46
pkg_resources/tests/data/my-test-package-source/setup.cfg
pkg_resources/tests/data/my-test-package-source/setup.cfg
+0
-0
pkg_resources/tests/data/my-test-package-source/setup.py
pkg_resources/tests/data/my-test-package-source/setup.py
+6
-0
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/PKG-INFO
...acked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/PKG-INFO
+10
-0
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/SOURCES.txt
...ed-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/SOURCES.txt
+7
-0
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/dependency_links.txt
..._test_package-1.0-py3.7.egg/EGG-INFO/dependency_links.txt
+1
-0
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/top_level.txt
...-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/top_level.txt
+1
-0
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/zip-safe
...acked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/zip-safe
+1
-0
pkg_resources/tests/data/my-test-package_zipped-egg/my_test_package-1.0-py3.7.egg
.../my-test-package_zipped-egg/my_test_package-1.0-py3.7.egg
+0
-0
pkg_resources/tests/test_find_distributions.py
pkg_resources/tests/test_find_distributions.py
+13
-45
pytest.ini
pytest.ini
+1
-1
No files found.
pkg_resources/tests/data/my-test-package-source/setup.cfg
0 → 100644
View file @
14c82188
pkg_resources/tests/data/my-test-package-source/setup.py
0 → 100644
View file @
14c82188
import
setuptools
setuptools
.
setup
(
name
=
"my-test-package"
,
version
=
"1.0"
,
zip_safe
=
True
,
)
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/PKG-INFO
0 → 100644
View file @
14c82188
Metadata-Version: 1.0
Name: my-test-package
Version: 1.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/SOURCES.txt
0 → 100644
View file @
14c82188
setup.cfg
setup.py
my_test_package.egg-info/PKG-INFO
my_test_package.egg-info/SOURCES.txt
my_test_package.egg-info/dependency_links.txt
my_test_package.egg-info/top_level.txt
my_test_package.egg-info/zip-safe
\ No newline at end of file
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/dependency_links.txt
0 → 100644
View file @
14c82188
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/top_level.txt
0 → 100644
View file @
14c82188
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/zip-safe
0 → 100644
View file @
14c82188
pkg_resources/tests/data/my-test-package_zipped-egg/my_test_package-1.0-py3.7.egg
0 → 100644
View file @
14c82188
File added
pkg_resources/tests/test_find_distributions.py
View file @
14c82188
import
subprocess
import
sys
import
py
import
pytest
import
pkg_resources
SETUP_TEMPLATE
=
"""
import setuptools
setuptools.setup(
name="my-test-package",
version="1.0",
zip_safe=True,
)
"""
.
lstrip
()
TESTS_DATA_DIR
=
py
.
path
.
local
(
__file__
).
dirpath
(
'data'
)
class
TestFindDistributions
:
...
...
@@ -21,46 +13,22 @@ class TestFindDistributions:
target_dir
=
tmpdir
.
mkdir
(
'target'
)
# place a .egg named directory in the target that is not an egg:
target_dir
.
mkdir
(
'not.an.egg'
)
return
str
(
target_dir
)
@
pytest
.
fixture
def
project_dir
(
self
,
tmpdir
):
project_dir
=
tmpdir
.
mkdir
(
'my-test-package'
)
(
project_dir
/
"setup.py"
).
write
(
SETUP_TEMPLATE
)
return
str
(
project_dir
)
return
target_dir
def
test_non_egg_dir_named_egg
(
self
,
target_dir
):
dists
=
pkg_resources
.
find_distributions
(
target_dir
)
dists
=
pkg_resources
.
find_distributions
(
str
(
target_dir
)
)
assert
not
list
(
dists
)
def
test_standalone_egg_directory
(
self
,
project_dir
,
target_dir
):
# install this distro as an unpacked egg:
args
=
[
sys
.
executable
,
'-c'
,
'from setuptools.command.easy_install import main; main()'
,
'-mNx'
,
'-d'
,
target_dir
,
'--always-unzip'
,
project_dir
,
]
subprocess
.
check_call
(
args
)
dists
=
pkg_resources
.
find_distributions
(
target_dir
)
def
test_standalone_egg_directory
(
self
,
target_dir
):
(
TESTS_DATA_DIR
/
'my-test-package_unpacked-egg'
).
copy
(
target_dir
)
dists
=
pkg_resources
.
find_distributions
(
str
(
target_dir
))
assert
[
dist
.
project_name
for
dist
in
dists
]
==
[
'my-test-package'
]
dists
=
pkg_resources
.
find_distributions
(
target_dir
,
only
=
True
)
dists
=
pkg_resources
.
find_distributions
(
str
(
target_dir
)
,
only
=
True
)
assert
not
list
(
dists
)
def
test_zipped_egg
(
self
,
project_dir
,
target_dir
):
# install this distro as an unpacked egg:
args
=
[
sys
.
executable
,
'-c'
,
'from setuptools.command.easy_install import main; main()'
,
'-mNx'
,
'-d'
,
target_dir
,
'--zip-ok'
,
project_dir
,
]
subprocess
.
check_call
(
args
)
dists
=
pkg_resources
.
find_distributions
(
target_dir
)
def
test_zipped_egg
(
self
,
target_dir
):
(
TESTS_DATA_DIR
/
'my-test-package_zipped-egg'
).
copy
(
target_dir
)
dists
=
pkg_resources
.
find_distributions
(
str
(
target_dir
))
assert
[
dist
.
project_name
for
dist
in
dists
]
==
[
'my-test-package'
]
dists
=
pkg_resources
.
find_distributions
(
target_dir
,
only
=
True
)
dists
=
pkg_resources
.
find_distributions
(
str
(
target_dir
)
,
only
=
True
)
assert
not
list
(
dists
)
pytest.ini
View file @
14c82188
[pytest]
addopts
=
--doctest-modules --doctest-glob=pkg_resources/api_tests.txt -r sxX
norecursedirs
=
dist build *.egg setuptools/extern pkg_resources/extern tools .*
norecursedirs
=
dist build *.egg setuptools/extern pkg_resources/extern
pkg_resources/tests/data
tools .*
flake8-ignore
=
setuptools/site-patch.py
F821
setuptools/py*compat.py
F811
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment