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
337c008c
Commit
337c008c
authored
Aug 21, 2018
by
Benoit Pierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setuptools: fix regression with `egg_info` command
Ensure version is tagged only once.
parent
d63b6b5b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
changelog.d/1465.change.rst
changelog.d/1465.change.rst
+1
-0
setuptools/command/egg_info.py
setuptools/command/egg_info.py
+8
-8
setuptools/tests/test_egg_info.py
setuptools/tests/test_egg_info.py
+16
-0
No files found.
changelog.d/1465.change.rst
0 → 100644
View file @
337c008c
Fix regression with `egg_info` command when tagging is used.
setuptools/command/egg_info.py
View file @
337c008c
...
...
@@ -160,7 +160,9 @@ class egg_info(InfoCommon, Command):
def initialize_options(self):
self.egg_base = None
self.egg_name = None
self.egg_info = None
self.egg_version = None
self.broken_egg_info = False
####################################
...
...
@@ -188,15 +190,13 @@ class egg_info(InfoCommon, Command):
egg_info['
tag_date
'] = 0
edit_config(filename, dict(egg_info=egg_info))
@property
def egg_name(self):
return self.name
@property
def egg_version(self):
return self.tagged_version()
def finalize_options(self):
# Note: we need to capture the current value returned
# by `self.tagged_version()`, so we can later update
# `self.distribution.metadata.version` without
# repercussions.
self.egg_name = self.name
self.egg_version = self.tagged_version()
parsed_version = parse_version(self.egg_version)
try:
...
...
setuptools/tests/test_egg_info.py
View file @
337c008c
...
...
@@ -570,3 +570,19 @@ class TestEggInfo:
raise
AssertionError
(
data
)
if
output
:
assert
output
in
data
def
test_egg_info_tag_only_once
(
self
,
tmpdir_cwd
,
env
):
self
.
_create_project
()
build_files
({
'setup.cfg'
:
DALS
(
"""
[egg_info]
tag_build = dev
tag_date = 0
tag_svn_revision = 0
"""
),
})
self
.
_run_egg_info_command
(
tmpdir_cwd
,
env
)
egg_info_dir
=
os
.
path
.
join
(
'.'
,
'foo.egg-info'
)
with
open
(
os
.
path
.
join
(
egg_info_dir
,
'PKG-INFO'
))
as
pkginfo_file
:
pkg_info_lines
=
pkginfo_file
.
read
().
split
(
'
\
n
'
)
assert
'Version: 0.0.0.dev0'
in
pkg_info_lines
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