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

Moving away from relying on setuptools develop mode #1729

Open
bmorris3 opened this issue Oct 12, 2022 · 6 comments
Open

Moving away from relying on setuptools develop mode #1729

bmorris3 opened this issue Oct 12, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@bmorris3
Copy link
Contributor

bmorris3 commented Oct 12, 2022

Invoking setup.py is deprecated (you can catch up on what's preferred in this blog post, for example). Currently, jdaviz still uses the setuptools.setup function in develop mode to make symlinks for our custom voila template, named jdaviz-default. The template is defined in the source code here, and the linking on python setup.py develop is done here.

An improvement option to investigate:

  • hatch is a python package manager that may cover our needs. Both voila (source) and Jupyter (source, blog) recently migrated to hatch, with the help of their hatch-jupyter-builder package.

Aside: @rosteen and I have found it helpful to find the available (=="installed"?) templates by running a script like this. Maybe we should offer a util like this to voila upstream?

🐱

@pllim
Copy link
Contributor

pllim commented Oct 12, 2022

Original motivation: @rosteen reported that he got missing template error running jdaviz CLI but only if pip install -e . was done and not pip install ., which would suggest that our current way of doing development install no longer works. I asked him to test this hypothesis to see if https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior would fix the development install (which would confirm that indeed our stuff is legacy). Ricky needs to get back on this.

voila upstream?

That would be a question for @maartenbreddels .

@pllim pllim added the bug Something isn't working label Oct 12, 2022
@ofek
Copy link

ofek commented Oct 24, 2022

Hatchling works by default for -e, see microsoft/pylance-release#3407

@maartenbreddels
Copy link
Collaborator

Hi @bmorris3

I think it would be best to first get a working version of say hatch and what is in voila-dashboards/voila#1250 in jdaviz before looking at voila-dashboards/voila#1250.
It may be a good idea to try to get pip install -e . working first.
I'm also not sure how pep-660 changes the situation, and of hatchling already supports that.

cheers,

Maarten

@ofek
Copy link

ofek commented Nov 29, 2022

It may be a good idea to try to get pip install -e . working first. I'm also not sure how pep-660 changes the situation, and of hatchling already supports that.

Yup supported! pip introduced support for PEP 660 in v21-3. Also, with Hatchling:

  • the implementation doesn't pollute the project with a *.egg-info directory
  • supports static analysis tools for editable installations by default whereas the new setuptools does not i.e. it requires enabling an option for IDEs to work

@maartenbreddels
Copy link
Collaborator

Could you point us to documentation/code on how this works/how this is implemented?

@ofek
Copy link

ofek commented Nov 29, 2022

https://hatch.pypa.io/latest/config/build/#dev-mode

Just .pth files unless enabling dev-mode-exact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants