Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-defaults
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
python-defaults
Commits
c3f8dd2d
Commit
c3f8dd2d
authored
14 years ago
by
Piotr Ożarowski
Browse files
Options
Downloads
Patches
Plain Diff
dh_python2 and pycompile: read /usr/share/python/debian_defaults to get
default Python version and a List of supported Python versions
parent
1063f88b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/changelog
+2
-0
2 additions, 0 deletions
debian/changelog
debpython/version.py
+24
-1
24 additions, 1 deletion
debpython/version.py
dh_python2.rst
+1
-1
1 addition, 1 deletion
dh_python2.rst
with
27 additions
and
2 deletions
debian/changelog
+
2
−
0
View file @
c3f8dd2d
python-defaults (2.6.6-11) UNRELEASED; urgency=low
* dh_python2 and pycompile: read /usr/share/python/debian_defaults to get
default Python version and a List of supported Python versions
* dh_python2:
- fix parsing .pyinstall files (a space between file name and
module name is now required)
...
...
This diff is collapsed.
Click to expand it.
debpython/version.py
+
24
−
1
View file @
c3f8dd2d
...
...
@@ -19,15 +19,38 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
import
logging
import
re
from
os.path
import
exists
from
ConfigParser
import
SafeConfigParser
from
os.path
import
exists
,
dirname
,
join
from
types
import
GeneratorType
# will be overriden via debian_defaults file few lines later
SUPPORTED
=
[(
2
,
5
),
(
2
,
6
),
(
2
,
7
)]
DEFAULT
=
(
2
,
6
)
RANGE_PATTERN
=
r
'
(-)?(\d\.\d+)(?:(-)(\d\.\d+)?)?
'
RANGE_RE
=
re
.
compile
(
RANGE_PATTERN
)
log
=
logging
.
getLogger
(
__name__
)
# try to read debian_defaults and get a list of supported Python versions and
# the default one from there
_config
=
SafeConfigParser
()
_config
.
read
([
'
/usr/share/python/debian_defaults
'
,
join
(
dirname
(
__file__
),
'
..
'
,
'
debian
'
,
'
debian_defaults
'
)])
try
:
DEFAULT
=
tuple
(
int
(
i
)
for
i
in
_config
.
get
(
'
DEFAULT
'
,
'
default-version
'
)[
6
:].
split
(
'
.
'
))
except
:
log
.
exception
(
'
cannot read debian_defaults
'
)
try
:
SUPPORTED
=
tuple
(
tuple
(
int
(
j
)
for
j
in
i
.
strip
()[
6
:].
split
(
'
.
'
))
\
for
i
in
_config
.
get
(
'
DEFAULT
'
,
'
supported-versions
'
).
split
(
'
,
'
))
except
:
log
.
exception
(
'
cannot read debian_defaults
'
)
def
get_requested_versions
(
vrange
=
None
,
available
=
None
):
"""
Return a set of requested and supported Python versions.
...
...
This diff is collapsed.
Click to expand it.
dh_python2.rst
+
1
−
1
View file @
c3f8dd2d
...
...
@@ -38,7 +38,7 @@ NOTES
In order to support more than one Python version in the same binary package,
dh_python2 (unlike dh_pycentral and dh_pysupport) creates symlinks to all
supported Python versions at build time. It means binNMU (or sourceful upload
in case of architecture independent packages)
are
required once a list of
in case of architecture independent packages)
is
required once a list of
supported Python version is changed. It's faster and more robust than its
competitors, though.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment