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
c7196901
Commit
c7196901
authored
Jan 19, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the Features feature. Fixes #65.
This commit reverts
e4460fad
.
parent
c389dd16
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
344 deletions
+7
-344
setup.py
setup.py
+0
-1
setuptools/__init__.py
setuptools/__init__.py
+3
-4
setuptools/dist.py
setuptools/dist.py
+3
-257
setuptools/tests/test_setuptools.py
setuptools/tests/test_setuptools.py
+1
-82
No files found.
setup.py
View file @
c7196901
...
...
@@ -91,7 +91,6 @@ setup_params = dict(
],
"setuptools.finalize_distribution_options"
:
[
"parent_finalize = setuptools.dist:_Distribution.finalize_options"
,
"features = setuptools.dist:Distribution._finalize_feature_opts"
,
"keywords = setuptools.dist:Distribution._finalize_setup_keywords"
,
"2to3_doctests = "
"setuptools.dist:Distribution._finalize_2to3_doctests"
,
...
...
setuptools/__init__.py
View file @
c7196901
"""Extensions to the 'distutils' for large or complex distributions"""
import
os
import
sys
import
functools
import
distutils.core
import
distutils.filelist
...
...
@@ -17,7 +16,7 @@ from setuptools.extern.six.moves import filter, map
import
setuptools.version
from
setuptools.extension
import
Extension
from
setuptools.dist
import
Distribution
,
Feature
from
setuptools.dist
import
Distribution
from
setuptools.depends
import
Require
from
.
import
monkey
...
...
@@ -25,13 +24,13 @@ __metaclass__ = type
__all__
=
[
'setup'
,
'Distribution'
,
'
Feature'
,
'
Command'
,
'Extension'
,
'Require'
,
'setup'
,
'Distribution'
,
'Command'
,
'Extension'
,
'Require'
,
'SetuptoolsDeprecationWarning'
,
'find_packages'
]
if
PY3
:
__all__
.
append
(
'find_namespace_packages'
)
__all__
.
append
(
'find_namespace_packages'
)
__version__
=
setuptools
.
version
.
__version__
...
...
setuptools/dist.py
View file @
c7196901
This diff is collapsed.
Click to expand it.
setuptools/tests/test_setuptools.py
View file @
c7196901
...
...
@@ -4,7 +4,7 @@ import sys
import
os
import
distutils.core
import
distutils.cmd
from
distutils.errors
import
DistutilsOptionError
,
DistutilsPlatformError
from
distutils.errors
import
DistutilsOptionError
from
distutils.errors
import
DistutilsSetupError
from
distutils.core
import
Extension
from
distutils.version
import
LooseVersion
...
...
@@ -14,7 +14,6 @@ import pytest
import
setuptools
import
setuptools.dist
import
setuptools.depends
as
dep
from
setuptools
import
Feature
from
setuptools.depends
import
Require
from
setuptools.extern
import
six
...
...
@@ -211,86 +210,6 @@ class TestDistro:
self
.
dist
.
exclude
(
package_dir
=
[
'q'
])
@
pytest
.
mark
.
filterwarnings
(
'ignore:Features are deprecated'
)
class
TestFeatures
:
def
setup_method
(
self
,
method
):
self
.
req
=
Require
(
'Distutils'
,
'1.0.3'
,
'distutils'
)
self
.
dist
=
makeSetup
(
features
=
{
'foo'
:
Feature
(
"foo"
,
standard
=
True
,
require_features
=
[
'baz'
,
self
.
req
]),
'bar'
:
Feature
(
"bar"
,
standard
=
True
,
packages
=
[
'pkg.bar'
],
py_modules
=
[
'bar_et'
],
remove
=
[
'bar.ext'
],
),
'baz'
:
Feature
(
"baz"
,
optional
=
False
,
packages
=
[
'pkg.baz'
],
scripts
=
[
'scripts/baz_it'
],
libraries
=
[(
'libfoo'
,
'foo/foofoo.c'
)]
),
'dwim'
:
Feature
(
"DWIM"
,
available
=
False
,
remove
=
'bazish'
),
},
script_args
=
[
'--without-bar'
,
'install'
],
packages
=
[
'pkg.bar'
,
'pkg.foo'
],
py_modules
=
[
'bar_et'
,
'bazish'
],
ext_modules
=
[
Extension
(
'bar.ext'
,
[
'bar.c'
])]
)
def
testDefaults
(
self
):
assert
not
Feature
(
"test"
,
standard
=
True
,
remove
=
'x'
,
available
=
False
).
include_by_default
()
assert
Feature
(
"test"
,
standard
=
True
,
remove
=
'x'
).
include_by_default
()
# Feature must have either kwargs, removes, or require_features
with
pytest
.
raises
(
DistutilsSetupError
):
Feature
(
"test"
)
def
testAvailability
(
self
):
with
pytest
.
raises
(
DistutilsPlatformError
):
self
.
dist
.
features
[
'dwim'
].
include_in
(
self
.
dist
)
def
testFeatureOptions
(
self
):
dist
=
self
.
dist
assert
(
(
'with-dwim'
,
None
,
'include DWIM'
)
in
dist
.
feature_options
)
assert
(
(
'without-dwim'
,
None
,
'exclude DWIM (default)'
)
in
dist
.
feature_options
)
assert
(
(
'with-bar'
,
None
,
'include bar (default)'
)
in
dist
.
feature_options
)
assert
(
(
'without-bar'
,
None
,
'exclude bar'
)
in
dist
.
feature_options
)
assert
dist
.
feature_negopt
[
'without-foo'
]
==
'with-foo'
assert
dist
.
feature_negopt
[
'without-bar'
]
==
'with-bar'
assert
dist
.
feature_negopt
[
'without-dwim'
]
==
'with-dwim'
assert
(
'without-baz'
not
in
dist
.
feature_negopt
)
def
testUseFeatures
(
self
):
dist
=
self
.
dist
assert
dist
.
with_foo
==
1
assert
dist
.
with_bar
==
0
assert
dist
.
with_baz
==
1
assert
(
'bar_et'
not
in
dist
.
py_modules
)
assert
(
'pkg.bar'
not
in
dist
.
packages
)
assert
(
'pkg.baz'
in
dist
.
packages
)
assert
(
'scripts/baz_it'
in
dist
.
scripts
)
assert
((
'libfoo'
,
'foo/foofoo.c'
)
in
dist
.
libraries
)
assert
dist
.
ext_modules
==
[]
assert
dist
.
require_features
==
[
self
.
req
]
# If we ask for bar, it should fail because we explicitly disabled
# it on the command line
with
pytest
.
raises
(
DistutilsOptionError
):
dist
.
include_feature
(
'bar'
)
def
testFeatureWithInvalidRemove
(
self
):
with
pytest
.
raises
(
SystemExit
):
makeSetup
(
features
=
{
'x'
:
Feature
(
'x'
,
remove
=
'y'
)})
class
TestCommandTests
:
def
testTestIsCommand
(
self
):
test_cmd
=
makeSetup
().
get_command_obj
(
'test'
)
...
...
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