Skip to content
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

Cleaning up stale installed files in setup() #21604

Closed
jdemeyer opened this issue Sep 27, 2016 · 17 comments
Closed

Cleaning up stale installed files in setup() #21604

jdemeyer opened this issue Sep 27, 2016 · 17 comments

Comments

@jdemeyer
Copy link
Contributor

This part of src/setup.py should be moved inside some distutils command:

#########################################################
### Clean
#########################################################

print('Cleaning up stale installed files....')
t = time.time()
from sage_setup.clean import clean_install_dir
output_dirs = SITE_PACKAGES + glob.glob(os.path.join(SAGE_SRC, 'build', 'lib*'))
for output_dir in output_dirs:
    print('- cleaning {0}'.format(output_dir))
    clean_install_dir(output_dir, python_packages, python_modules,
            ext_modules, python_data_files)
print('Finished cleaning, time: %.2f seconds.' % (time.time() - t))

Depends on #21480

CC: @mkoeppe

Component: build

Author: Jeroen Demeyer

Branch/Commit: 5ba95ed

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/21604

@jdemeyer jdemeyer added this to the sage-7.4 milestone Sep 27, 2016
@jdemeyer
Copy link
Contributor Author

@jdemeyer
Copy link
Contributor Author

New commits:

274d8b3Clean up stale installed files in install command

@jdemeyer
Copy link
Contributor Author

Commit: 274d8b3

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 27, 2016

comment:3

Could you add a few lines of comments to the patch that explain what "stale installed files" are?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 28, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

e50f978Add some documentation

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 28, 2016

Changed commit from 274d8b3 to e50f978

@jdemeyer
Copy link
Contributor Author

Dependencies: #21580

@jdemeyer
Copy link
Contributor Author

Changed dependencies from #21580 to #21480

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 28, 2016

Changed commit from e50f978 to 5ba95ed

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 28, 2016

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

751bd0fReword TODO item
3a8cc0eFix typo in comment
0dd9c50Respect environment variable MAKE
17f90d8beautification
e5f9065More comments
7791cd9Remove --buildbase code
74169e7Pass SAGE_SRC to generate_py_source.mk
0394333Add new file to MANIFEST.in
fdedb02Install SAGE_LOCAL/bin/sage instead of SAGE_ROOT/sage as Jupyter kernel
5ba95edClean up stale installed files in install command

@jdemeyer
Copy link
Contributor Author

comment:8

Rebased on top of #21480.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 29, 2016

Reviewer: Matthias Koeppe

@embray
Copy link
Contributor

embray commented Oct 5, 2016

comment:10

As I wrote in #21600 this makes sense, but I think this should happen prior to any "build" command, not just at install time, since this is really an issue of keeping around a build/ dir from a previous build and expecting to be able to reuse it for a new build. I can appreciate the need for that, I would just move this step earlier, maybe even as a sub-command of build. If you don't mind, I can update this with what I have in mind.

@jdemeyer
Copy link
Contributor Author

jdemeyer commented Oct 5, 2016

comment:11

Replying to @embray:

As I wrote in #21600 this makes sense, but I think this should happen prior to any "build" command, not just at install time, since this is really an issue of keeping around a build/ dir from a previous build and expecting to be able to reuse it for a new build. I can appreciate the need for that, I would just move this step earlier, maybe even as a sub-command of build. If you don't mind, I can update this with what I have in mind.

Couldn't this be done as follow-up ticket? Otherwise we will never make progress.

What you say makes sense, but the changes made in this ticket also make sense.

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2016

comment:12

I agree with Jeroen.
This ticket is an important step, moving the "clean" part inside of setup. So, for example, setup.py --help no longer invokes cleaning.
A follow-up ticket (please make one) should disentangle the cleaning of the build directory and the cleaning of the install directory.

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2016

comment:14

I've created the follow-up ticket at #21654.

@vbraun
Copy link
Member

vbraun commented Oct 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants