-
Notifications
You must be signed in to change notification settings - Fork 79
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
proposal for setup.py revision for issue #1729 #1792
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1792 +/- ##
==========================================
+ Coverage 87.82% 87.89% +0.06%
==========================================
Files 95 95
Lines 10178 10185 +7
==========================================
+ Hits 8939 8952 +13
+ Misses 1239 1233 -6 ☔ View full report in Codecov by Sentry. |
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.
I was expecting that we can get rid of cmdclass={'develop': DevelopCmd}
altogether but I don't see that happening in the diff.
@@ -2,6 +2,7 @@ | |||
|
|||
requires = ["setuptools", | |||
"setuptools_scm", | |||
"wheel"] | |||
"wheel", | |||
"voila"] |
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.
👎 on this because it introduces voila as build-time dependency even though it is only needed for the standalone app part.
But you say we don't need this if some stuff is moved upstream? If that is the case, should we move the stuff upstream and not deal with this at all?
I think this is the case for myself, and really just has to be done once on the machine not for each environment (assuming the voila templates don't change, which they don't often). So if for some reason we decide not to go forward with this, we could alternatively put this somewhere in the dev docs instead. |
Something that just struck me, which might be relevant here. We should make sure we aren't running in circles here: #925 We removed symlinking as part of our build process because it requires administrative rights on Windows. |
@bmorris3 Can we close this, given that we no longer use Voila? |
This is not necessary anymore. |
Background
This pull request explores options for updating
setup.py
. At present, there are several ways for a user to install jdaviz, which each have slightly different behaviors, especially with regards to installing the voila template. Important background: the "jdaviz voila template" is a series of files located withinshare/
. I'll refer to copying or symlinking the jdaviz voila template files into a location where voila expects to find them as "installing" the custom template.The options are:
Install with
python setup.py install
orpip install .
. Setuptools will copy the data files being passed through thesetup(data_files=data_files)
keyword argument into the correct locations (background). The copy of the template files is static.Install with
python setup.py develop
, which has been deprecated. In that case, our custom develop command class insetup.py
gets triggered, which tries to make a symlink, or if not, a copy of the directories.You can also do
pip install -e .
, which does not use thedata_files
kwarg given to setuptools, nor does it use the customdevelop
command class. No template files get copied when you do the developer install. This seems to arise from subtleties in the differences betweenpython setup.py develop
andpip install -e .
, which are not identical implementations.Since most users are
pip install
ing jdaviz, they get the template files successfully viadata_files
. I'm wondering if devs haven't hit a problem with this workflow because at some point, we all oncepip install
ed jdaviz, which gives us the template, before callingpip install -e .
for development, which does not give you the template.Description
This PR does a few things:
Moves the template management operations out of the methods on the custom subclass of
develop
, and into self-contained functions insetup.py
.Introduces a custom<- update: It turns out that moving to symlink defaults can fail, so I'm removing this feature and falling back to relying on theinstall
subclass that uses exactly the same template symlink/copy operation asdevelop
.data_files
kwarg to install a copy of the files.Adds
voila
topyproject.toml
so that we can use the voila template path finding functions within oursetup.py
file(1) implements functions that users could intentionally call to symlink/copy their custom template files without re-installing the custom files' host package (jdaviz in this case). I'm implementing these functions with the expectation that they might belong in an upstream PR to voila. Any thoughts? (Sidebar: at first, I also wanted users to be able to call these functions at will in case they/we edit the templates, but it turns out you can't import functions from a
setup.py
file 🤷🏻♂️. Oh well.) With (2), I was trying toreduce some of the uniqueness ofupdate: but I have since had to ditch that effort and keep them different. (3) is required for now, but if (1) becomes a PR to voila, then (3) can be removed.install
vsdevelop
I hope this is useful for @rosteen, satisfies @kecnry's hesitance to introduce dependencies, and successfully meets the criteria to close #1729. I'm marking no-changelog-entry-needed because users shouldn't notice a difference.
Fixes #1729
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.