Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
28
Issues
28
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools
Commits
3a824692
Commit
3a824692
authored
Apr 16, 2015
by
Eric Coissac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use setuptools instead of distutils as much as possible
parent
edfa796c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
37 deletions
+41
-37
distutils.ext/obidistutils/command/install.py
distutils.ext/obidistutils/command/install.py
+6
-1
distutils.ext/obidistutils/command/install_scripts.py
distutils.ext/obidistutils/command/install_scripts.py
+6
-1
distutils.ext/obidistutils/command/sdist.py
distutils.ext/obidistutils/command/sdist.py
+5
-1
distutils.ext/obidistutils/core.py
distutils.ext/obidistutils/core.py
+20
-32
distutils.ext/obidistutils/dist.py
distutils.ext/obidistutils/dist.py
+4
-2
No files found.
distutils.ext/obidistutils/command/install.py
View file @
3a824692
...
...
@@ -4,7 +4,12 @@ Created on 6 oct. 2014
@author: coissac
'''
from
distutils.command.install
import
install
as
install_ori
try
:
from
setuptools.command.install
import
install
as
install_ori
has_setuptools
=
True
except
ImportError
:
from
distutils.command.install
import
install
as
install_ori
has_setuptools
=
False
class
install
(
install_ori
):
...
...
distutils.ext/obidistutils/command/install_scripts.py
View file @
3a824692
...
...
@@ -3,8 +3,13 @@ Created on 20 oct. 2012
@author: coissac
'''
try
:
from
setuptools.command.install_scripts
import
install_scripts
as
ori_install_scripts
has_setuptools
=
True
except
ImportError
:
from
distutils.command.install_scripts
import
install_scripts
as
ori_install_scripts
has_setuptools
=
False
from
distutils.command.install_scripts
import
install_scripts
as
ori_install_scripts
import
os.path
from
distutils
import
log
...
...
distutils.ext/obidistutils/command/sdist.py
View file @
3a824692
...
...
@@ -6,7 +6,11 @@ Created on 10 mars 2015
import
os.path
from
distutils.command.sdist
import
sdist
as
orig_sdist
try
:
from
setuptools.command.sdist
import
sdist
as
orig_sdist
except
ImportError
:
from
distutils.command.sdist
import
sdist
as
orig_sdist
from
distutils
import
dir_util
class
sdist
(
orig_sdist
):
...
...
distutils.ext/obidistutils/core.py
View file @
3a824692
...
...
@@ -11,12 +11,12 @@ import sys
from
obidistutils.command.sdist
import
sdist
#
try:
#
from setuptools import setup as ori_setup
#
has_setuptools = True
#
except ImportError:
from
distutils.core
import
setup
as
ori_setup
#
has_setuptools = False
try
:
from
setuptools
import
setup
as
ori_setup
has_setuptools
=
True
except
ImportError
:
from
distutils.core
import
setup
as
ori_setup
has_setuptools
=
False
from
distutils.extension
import
Extension
...
...
@@ -136,32 +136,20 @@ FILES =[]
def
setup
(
**
attrs
):
# if has_setuptools:
# try:
#
# requirements = open('requirements.txt').readlines()
# requirements = [x.strip() for x in requirements]
# requirements = [x for x in requirements if x[0]!='-']
#
# if 'install_requires' not in attrs:
# attrs['install_requires']=requirements
# else:
# attrs['install_requires'].extend(requirements)
# except IOError:
# pass
try
:
requirements
=
open
(
'requirements.txt'
).
readlines
()
requirements
=
[
x
.
strip
()
for
x
in
requirements
]
requirements
=
[
x
for
x
in
requirements
if
x
[
0
]
!=
'-'
]
if
'install_requires'
not
in
attrs
:
attrs
[
'install_requires'
]
=
requirements
else
:
attrs
[
'install_requires'
].
extend
(
requirements
)
except
IOError
:
pass
if
has_setuptools
:
try
:
requirements
=
open
(
'requirements.txt'
).
readlines
()
requirements
=
[
x
.
strip
()
for
x
in
requirements
]
requirements
=
[
x
for
x
in
requirements
if
x
[
0
]
!=
'-'
]
if
'install_requires'
not
in
attrs
:
attrs
[
'install_requires'
]
=
requirements
else
:
attrs
[
'install_requires'
].
extend
(
requirements
)
except
IOError
:
pass
if
'distclass'
not
in
attrs
:
attrs
[
'distclass'
]
=
Distribution
...
...
distutils.ext/obidistutils/dist.py
View file @
3a824692
...
...
@@ -4,8 +4,10 @@ Created on 20 oct. 2012
@author: coissac
'''
from
distutils.dist
import
Distribution
as
ori_Distribution
try
:
from
setuptools.dist
import
Distribution
as
ori_Distribution
except
ImportError
:
from
distutils.dist
import
Distribution
as
ori_Distribution
class
Distribution
(
ori_Distribution
):
...
...
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