Skip to content

Update setup.py to use more modern Python packaging

Dave Moxey requested to merge dmoxey/nektar:fix/python-setup-py into master

Issue/feature addressed

Recent Python releases have deprecated distutils in favour of more modern packaging through pip. This MR adds the

Proposed solution

  • setup.py now uses setuptools via setup.cfg, also removes the need to hard-code NekPy libraries within setup.py
  • to isolate the packaging build, we use ${CMAKE_BINARY_DIR}/python to store the NekPy package and associated packaging
  • Targets nekpy-install-* are adjusted to instead use pip install
  • A new target nekpy-install-dev passes the -e option to pip install which puts a symlink to the package in site-packages and means that multiple calls to nekpy-install-user are not required for development purposes.

Tests

Suggested reviewers

@CFD-Xing @ssherw

Notes

Please add any other information that could be useful for reviewers.

Checklist

  • [ ] Functions and classes, or changes to them, are documented.
  • [ ] User guide/documentation is updated.
  • Changelog is updated.
  • [ ] Suitable tests added for new functionality.
  • Contributed code is correctly formatted. (See the contributing guidelines).
  • [ ] License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).
Edited by Dave Moxey

Merge request reports