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
a96ab21c
Commit
a96ab21c
authored
Feb 01, 2021
by
Jason R. Coombs
Committed by
GitHub
Feb 01, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2543 from pypa/bugfix/1996-no-bootstrap
Remove bootstrap script
parents
e1ffc2ab
e3e7ff85
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
4 additions
and
158 deletions
+4
-158
bootstrap.py
bootstrap.py
+3
-53
changelog.d/1527.breaking.rst
changelog.d/1527.breaking.rst
+1
-0
docs/conf.py
docs/conf.py
+0
-16
pyproject.toml
pyproject.toml
+0
-1
setup.py
setup.py
+0
-12
tools/tox_pip.py
tools/tox_pip.py
+0
-70
tox.ini
tox.ini
+0
-6
No files found.
bootstrap.py
View file @
a96ab21c
"""
If setuptools is not already installed in the environment, it's not possible
to invoke setuptools' own commands. This routine will bootstrap this local
environment by creating a minimal egg-info directory and then invoking the
egg-info command to flesh out the egg-info directory.
"""
import
warnings
import
os
import
sys
import
textwrap
import
subprocess
import
io
msg
=
"bootstrap.py is no longer needed. Use a PEP-517-compatible builder instead."
minimal_egg_info
=
textwrap
.
dedent
(
"""
[distutils.commands]
egg_info = setuptools.command.egg_info:egg_info
[distutils.setup_keywords]
include_package_data = setuptools.dist:assert_bool
install_requires = setuptools.dist:check_requirements
extras_require = setuptools.dist:check_extras
entry_points = setuptools.dist:check_entry_points
[egg_info.writers]
PKG-INFO = setuptools.command.egg_info:write_pkg_info
dependency_links.txt = setuptools.command.egg_info:overwrite_arg
entry_points.txt = setuptools.command.egg_info:write_entries
requires.txt = setuptools.command.egg_info:write_requirements
"""
)
def
ensure_egg_info
():
if
os
.
path
.
exists
(
'setuptools.egg-info'
):
return
print
(
"adding minimal entry_points"
)
add_minimal_info
()
run_egg_info
()
def
add_minimal_info
():
"""
Build a minimal egg-info, enough to invoke egg_info
"""
os
.
mkdir
(
'setuptools.egg-info'
)
with
io
.
open
(
'setuptools.egg-info/entry_points.txt'
,
'w'
)
as
ep
:
ep
.
write
(
minimal_egg_info
)
def
run_egg_info
():
cmd
=
[
sys
.
executable
,
'setup.py'
,
'egg_info'
]
print
(
"Regenerating egg_info"
)
subprocess
.
check_call
(
cmd
)
__name__
==
'__main__'
and
ensure_egg_info
()
__name__
==
'__main__'
and
warnings
.
warn
(
msg
)
changelog.d/1527.breaking.rst
0 → 100644
View file @
a96ab21c
Removed bootstrap script. Now Setuptools requires pip or another pep517-compliant builder such as 'build' to build. Now Setuptools can be installed from Github main branch.
docs/conf.py
View file @
a96ab21c
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import
subprocess
import
sys
import
os
extensions
=
[
'sphinx.ext.autodoc'
,
'jaraco.packaging.sphinx'
,
'rst.linker'
]
master_doc
=
"index"
...
...
@@ -82,14 +74,6 @@ link_files = {
}
# hack to run the bootstrap script so that jaraco.packaging.sphinx
# can invoke setup.py
'
READTHEDOCS
' in os.environ and subprocess.check_call(
[sys.executable, '
-
m
', '
bootstrap
'],
cwd=os.path.join(os.path.dirname(__file__), os.path.pardir),
)
# Add support for linking usernames
github_url = '
https
:
//
github
.
com
'
github_sponsors_url = f'
{
github_url
}
/
sponsors
'
...
...
pyproject.toml
View file @
a96ab21c
[build-system]
requires
=
[
# avoid self install on Python 2; ref #1996
"setuptools >= 40.8; python_version > '3'"
,
"wheel"
,
]
...
...
setup.py
View file @
a96ab21c
...
...
@@ -10,17 +10,6 @@ from setuptools.command.install import install
here
=
os
.
path
.
dirname
(
__file__
)
def
require_metadata
():
"Prevent improper installs without necessary metadata. See #659"
egg_info_dir
=
os
.
path
.
join
(
here
,
'setuptools.egg-info'
)
if
not
os
.
path
.
exists
(
egg_info_dir
):
msg
=
(
"Cannot build setuptools without metadata. "
"Run `bootstrap.py`."
)
raise
RuntimeError
(
msg
)
def
read_commands
():
command_ns
=
{}
cmd_module_path
=
'setuptools/command/__init__.py'
...
...
@@ -170,5 +159,4 @@ setup_params = dict(
if
__name__
==
'__main__'
:
# allow setup.py to run from another directory
here
and
os
.
chdir
(
here
)
require_metadata
()
dist
=
setuptools
.
setup
(
**
setup_params
)
tools/tox_pip.py
deleted
100644 → 0
View file @
e1ffc2ab
import
os
import
subprocess
import
sys
import
re
def
remove_setuptools
():
"""
Remove setuptools from the current environment.
"""
print
(
"Removing setuptools"
)
cmd
=
[
sys
.
executable
,
'-m'
,
'pip'
,
'uninstall'
,
'-y'
,
'setuptools'
]
# set cwd to something other than '.' to avoid detecting
# '.' as the installed package.
subprocess
.
check_call
(
cmd
,
cwd
=
os
.
environ
[
'TOX_WORK_DIR'
])
def
bootstrap
():
print
(
"Running bootstrap"
)
cmd
=
[
sys
.
executable
,
'-m'
,
'bootstrap'
]
subprocess
.
check_call
(
cmd
)
def
is_install_self
(
args
):
"""
Do the args represent an install of .?
"""
def
strip_extras
(
arg
):
match
=
re
.
match
(
r'(.*)?\
[.*
\]$'
,
arg
)
return
match
.
group
(
1
)
if
match
else
arg
return
(
'install'
in
args
and
any
(
arg
in
[
'.'
,
os
.
getcwd
()]
for
arg
in
map
(
strip_extras
,
args
)
)
)
def
pip
(
*
args
):
cmd
=
[
sys
.
executable
,
'-m'
,
'pip'
]
+
list
(
args
)
return
subprocess
.
check_call
(
cmd
)
def
test_dependencies
():
from
ConfigParser
import
ConfigParser
def
clean
(
dep
):
spec
,
_
,
_
=
dep
.
partition
(
'#'
)
return
spec
.
strip
()
parser
=
ConfigParser
()
parser
.
read
(
'setup.cfg'
)
raw
=
parser
.
get
(
'options.extras_require'
,
'tests'
).
split
(
'
\
n
'
)
return
filter
(
None
,
map
(
clean
,
raw
))
def
run
(
args
):
os
.
environ
[
'PIP_USE_PEP517'
]
=
'true'
if
is_install_self
(
args
):
remove_setuptools
()
bootstrap
()
pip
(
*
args
)
if
__name__
==
'__main__'
:
run
(
sys
.
argv
[
1
:])
tox.ini
View file @
a96ab21c
...
...
@@ -11,8 +11,6 @@ commands =
pytest
{posargs}
usedevelop
=
True
extras
=
testing
install_command
=
{[helpers]pip} install {opts} {packages}
list_dependencies_command
=
{[helpers]pip} freeze --all
setenv
=
COVERAGE_FILE
=
{toxworkdir}/.coverage.{envname}
passenv
=
...
...
@@ -74,7 +72,3 @@ commands =
python
-m
twine
upload
dist/*
python
-m
jaraco.develop.create-github-release
python
-m
jaraco.tidelift.publish-release-notes
[helpers]
# Custom pip behavior
pip
=
python {toxinidir}/tools/tox_pip.py
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