-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use setup.py
directly rather than pip install
#203
Conversation
I think pip refuses to uninstall packages installed by Perhaps just running |
The second question is then what to do with building dependencies --- if the environment in asv is not torn down every time, using ccache for those is probably not so important? |
At least experimentally on a dummy package that uses only vanilla distutils and no setuptools, this appears to be true. As for the dependencies, you are correct that they are still being built with random paths, therefore ccache doesn't work. But they are cached in the |
This works fine for me. Does it break the parallel build feature however? |
I does break the parallel build feature. For a couple of other corner case reasons, I've been meaning to fix the parallel build feature so that each parallel thread would use its own |
f931397
to
ad4b91d
Compare
This now makes a separate clone of the project repository for each environment (these are The combination of parallel building, ccache working and cached wheels makes things much faster overall. Too bad there isn't a tool to measure that ;) |
project. This gives ccache a better chance of doing its thing.
Conflicts: asv/benchmarks.py asv/commands/find.py asv/commands/profiling.py asv/commands/run.py asv/environment.py asv/plugins/conda.py asv/plugins/virtualenv.py
00427ec
to
201042a
Compare
Seems to break asv dev, cf pv/asv@1addad0 |
if self._wheel_cache_size == 0: | ||
return None | ||
|
||
if not os.path.isdir(self._path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should be moved --- the directory is first created by the call to _get_wheel
_create_wheel_cache_path
below.
My logic here with _get_wheel_cache_path
creating the directory was a bit funky...
pv/asv@6762b7dd29f
Worksforme apart from those two |
Thanks. I think I've addressed those two issues. |
The isdir check probably needs to be added to |
Indeed. I think it's fixed now. |
def _get_wheel(self, commit_hash): | ||
cache_path = self._get_wheel_cache_path(commit_hash) | ||
|
||
if not os.isdir(cache_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.path.isdir
46a9ffa
to
cf95250
Compare
orig_level = self._logger.level | ||
self._logger.setLevel(level) | ||
yield | ||
self._logger.setLevel(orig_level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't set the level back if an exception is raised (eg build failure), may be related to gh-209
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I've cherry-picked 044b8d6 over to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use `setup.py` directly rather than `pip install`
This results in building the project in the same directory every time, giving ccache a better chance of doing its thing. An alternate solution to #201.
pip install /some/local/path
has been used in asv to install the benchmarked project on the assumption thatpip
knows better about the details of how to install a Python package beyond just the usualsetup.py install
. However, I wonder if that's really the case...Note that I tried to use the
--build
flag forpip install
to force it to build in a specific directory. This seems to work for remote packages, but it's ignored when given a local path...Attn: @pv