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

Fix deprecation warning regarding setup.py and pyproject.toml #1384

Open
kinow opened this issue Aug 7, 2024 · 6 comments
Open

Fix deprecation warning regarding setup.py and pyproject.toml #1384

kinow opened this issue Aug 7, 2024 · 6 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Milestone

Comments

@kinow
Copy link
Member

kinow commented Aug 7, 2024

While reviewing @naiaraAM 's code in !459 , I created a new Micromamba env on a new laptop, and doing everything over from scratch I got this warning with Py 3.9.12 running pip install -e .:

DEPRECATION: Legacy editable install of autosubmit==4.1.9 from file:///home/kinow/Development/python/workspace/autosubmit (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at pypa/pip#11457

It's probably better that we fix this earlier, instead of waiting until they remove it which may prevent AS from working with newer versions of Python for a simple issue that can be fixed in under one hour.

@kinow
Copy link
Member Author

kinow commented Aug 12, 2024

In GitLab by @edgano on Aug 12, 2024, 13:53

Looking for more info about these. I found this info here: https://packaging.python.org/en/latest/discussions/setup-py-deprecated/

What commands should be used instead?

Deprecated Recomendation
python setup.py install python -m pip install .
... ...

But not sure which could be the best strategy

@kinow
Copy link
Member Author

kinow commented Aug 12, 2024

I think calling python setup.py install directly has been considered old/deprecated for a long time. Some scripts that I used in the past did not work correctly when called directly like that.

I think either python -m pip install . or just pip install . should be OK.

The error, I believe, is due to the missing pyproject.toml. Other projects have added or migrated to pyproject.toml. It would be hard for us to migrate, I think, as I don't know if the way we retrieve the project version would work.

But we can add a pyproject.toml and move part of the metadata, to see if the deprecation warning goes away. Then in the future we can move more things, and follow the PEP's and see which direction we need/want to follow.

WDYT?

@kinow
Copy link
Member Author

kinow commented Aug 12, 2024

In GitLab by @edgano on Aug 12, 2024, 14:25

A ok!
yes, that sounds good ;) a good way to test without breaking anything. IDK what the others thinks about it

@dbeltrankyl
Copy link
Contributor

In relation to this, we should also fix this:

https://autosubmit.readthedocs.io/en/master/installation/index.html#installation

The docs are still referring to the use

python3 setup.py install

Which won't work because it doesn't download the dependencies of Autosubmit.

git clone -b $current_display_version https://github.com/BSC-ES/autosubmit
cd autosubmit
pip install . 

Would be more appropriate.

I think this should be done for v4.1.13, to avoid external user issues which are always harder to track.

@dbeltrankyl
Copy link
Contributor

It may be a good issue for @isimo00 or @VindeeR

@dbeltrankyl dbeltrankyl added the documentation Improvements or additions to documentation label Jan 23, 2025
@dbeltrankyl dbeltrankyl modified the milestones: 4.1.12, 4.1.13 Jan 23, 2025
@kinow
Copy link
Member Author

kinow commented Jan 23, 2025

Yeah, and this is a really annoying one, because I see this warning every week, nearly every day when I pip install -e . Autosubmit 😆

@VindeeR VindeeR assigned VindeeR and unassigned VindeeR Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants