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
7de0c4db
Commit
7de0c4db
authored
Oct 19, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge Pull Request #97
parents
6281ff54
c6452472
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
CHANGES.txt
CHANGES.txt
+12
-0
setuptools/dist.py
setuptools/dist.py
+19
-2
setuptools/win32.py
setuptools/win32.py
+19
-0
No files found.
CHANGES.txt
View file @
7de0c4db
...
...
@@ -2,6 +2,18 @@
CHANGES
=======
----------
Unreleased
----------
* Issue #80, #209: Eggs that are downloaded for ``setup_requires``,
``test_requires``, etc. are now placed in a ``.eggs`` directory instead of
the package root directory. This is a better place for them as it doesn't
cause later phases of setuptools to think that the package is already
installed and then not install the package permanently in the environment
(See #209).
---
6.1
---
...
...
setuptools/dist.py
View file @
7de0c4db
...
...
@@ -14,7 +14,8 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError
)
from
setuptools.depends
import
Require
from
setuptools.compat
import
basestring
,
PY2
from
setuptools.compat
import
basestring
,
PY2
,
unicode
from
setuptools
import
win32
import
pkg_resources
def
_get_unpatched
(
cls
):
...
...
@@ -305,6 +306,21 @@ class Distribution(_Distribution):
else:
self.convert_2to3_doctests = []
def get_egg_cache_dir(self):
egg_cache_dir = os.path.join(os.curdir, '
.
eggs
')
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
win32.hide_file(unicode(egg_cache_dir))
readme_txt_filename = os.path.join(egg_cache_dir, '
README
.
txt
')
with open(readme_txt_filename, '
w
') as f:
f.write('
This
directory
contains
eggs
that
were
downloaded
'
'
by
setuptools
to
build
,
test
,
and
run
plug
-
ins
.
\
n
\
n
')
f.write('
This
directory
caches
those
eggs
to
prevent
'
'
repeated
downloads
.
\
n
\
n
')
f.write('
However
,
it
is
safe
to
delete
this
directory
.
\
n
\
n
')
return egg_cache_dir
def fetch_build_egg(self, req):
"""Fetch an egg needed for building"""
...
...
@@ -328,8 +344,9 @@ class Distribution(_Distribution):
if
'find_links'
in
opts
:
links
=
opts
[
'find_links'
][
1
].
split
()
+
links
opts
[
'find_links'
]
=
(
'setup'
,
links
)
install_dir
=
self
.
get_egg_cache_dir
()
cmd
=
easy_install
(
dist
,
args
=
[
"x"
],
install_dir
=
os
.
cur
dir
,
exclude_scripts
=
True
,
dist
,
args
=
[
"x"
],
install_dir
=
install_
dir
,
exclude_scripts
=
True
,
always_copy
=
False
,
build_directory
=
None
,
editable
=
False
,
upgrade
=
False
,
multi_version
=
True
,
no_report
=
True
,
user
=
False
)
...
...
setuptools/win32.py
0 → 100644
View file @
7de0c4db
# From http://stackoverflow.com/questions/19622133/python-set-hide-attribute-on-folders-in-windows-os
import
ctypes
def
hide_file
(
path
):
"""Sets the hidden attribute on a file or directory
`path` must be unicode; be careful that you escape backslashes or use raw
string literals - e.g.: `u'G:
\
\
Dir
\
\
folder1'` or `ur'G:
\
Di
r
\
f
older1'`.
"""
SetFileAttributesW
=
ctypes
.
windll
.
kernel32
.
SetFileAttributesW
FILE_ATTRIBUTE_HIDDEN
=
0x02
ret
=
SetFileAttributesW
(
path
,
FILE_ATTRIBUTE_HIDDEN
)
if
not
ret
:
raise
ctypes
.
WinError
()
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