Skip to content

Conversation

jclarkeSTFC
Copy link
Contributor

@jclarkeSTFC jclarkeSTFC commented Aug 9, 2024

See here for details about the warning. We were calling python setup.py develop, but this now seems to be a faux pas, so I've changed it use the recommended alternative.

I changed the test because it was giving a false positive, when calling pip install --editable you will get something like __editable ... mantidqt ... in sys.modules, but that doesn't mean you've imported mantidqt. The test was trying to check that importing mantid.simpleapi doesn't import mantidqt, which it doesn't, you can check this manually pretty quickly at the REPL.

Fixes #37277

https://builds.mantidproject.org/job/build_packages_from_branch/870/

To test:

  • Check package builds works fine
  • Try importing mantid.simpleapi and check that mantidqt isn't imported
  • When you build there should be no warnings in the output like the examples in Setuptools deprecations #37277

This does not require release notes because it will have no effect on the user


Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@jclarkeSTFC jclarkeSTFC added Maintenance Unassigned issues to be addressed in the next maintenance period. ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions labels Aug 9, 2024
@jclarkeSTFC jclarkeSTFC added this to the Release 6.11 milestone Aug 9, 2024
@jclarkeSTFC jclarkeSTFC marked this pull request as ready for review August 20, 2024 15:04
@sf1919
Copy link
Contributor

sf1919 commented Aug 21, 2024

Unfortunately the package build got a little stuck last night so it needed to be cancelled (it started doing docs tests late last night but hadn't resolved after 6 hours or so). Please can you set off a new package build?

@jhaigh0 jhaigh0 self-assigned this Aug 21, 2024
Replace `python setup.py develop` with `python -m pip install --editable .` This
is from the migration instructions online.
This way is much cleaner, plus it will prevent any false positives if
the module string is contained within another key. E.g. since moving
to pip -m install --editable the editable packages appear in the
sys.modules dict, but as something like '__editable_mantidqt_...',
but this doesn't mean than mantidqt has been imported.
The workbench file is not going to be generated in the
bin folder any more now that we're using pip instead
of calling setup.py, but you can just call workbench
as a python command, so edit the launch_mantidworkbench
script to reflect this.
@jclarkeSTFC jclarkeSTFC force-pushed the 37277_fix_setuptools_deprecations branch from e6118ec to 57cbc5e Compare August 21, 2024 13:34
@jhaigh0
Copy link
Contributor

jhaigh0 commented Aug 29, 2024

Build works with no setuptools warnings. Windows exe installs correctly with the import working as it should. 👍

Last thing to do will be to check the conda install is okay.

Copy link
Contributor

@jhaigh0 jhaigh0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did a test upload to my anaconda channel and it install and opened correctly

@peterfpeterson peterfpeterson merged commit 6c27d44 into main Sep 4, 2024
@peterfpeterson peterfpeterson deleted the 37277_fix_setuptools_deprecations branch September 4, 2024 14:05
This was referenced Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions Maintenance Unassigned issues to be addressed in the next maintenance period.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setuptools deprecations
5 participants