Skip to content

Conversation

@bjlittle
Copy link
Member

@bjlittle bjlittle commented Jun 2, 2021

🚀 Pull Request

Description

This PR rationalises the setup.py into the setup.cfg.

As a justification for this, see this setuptools advise on Transitioning from setup.py to setup.cfg and Transitional Note i.e., the setuptools devs are pushing the community to use setup.cfg rather than setup.py.

Although, note that a minimal setup.py is still required if your project requires to perform a pip install --editable, see setuptools setup.cfg-only projects.

Note that, we've now unified all the PyPI requirements under setup.cfg and users have the option to install dependencies as they need i.e.,

  • pip install iris[docs]
  • pip install iris[test]
  • pip install iris[all]
  • pip install iris[docs,test]

Consult Iris pull request check list

@pp-mo
Copy link
Member

pp-mo commented Jun 3, 2021

Just taking a quick initial look here + wanting to make a more general point :
I'm disappointed that setup.py wasn't simplified still more.
Much of the remaining fuss is to provide the 'custom commands' from setup.py.
Is there now a "better way" for those ?

@bjlittle
Copy link
Member Author

bjlittle commented Jun 3, 2021

Just taking a quick initial look here + wanting to make a more general point :
I'm disappointed that setup.py wasn't simplified still more.
Much of the remaining fuss is to provide the 'custom commands' from setup.py.
Is there now a "better way" for those ?

@pp-mo At his moment in time, not that I know of... but this PR is certainly a step in the right direction IMHO

If and when building extensions and custom commands is possible outside setup.py, then I'd hope that is additive to the changes proposed here.

@trexfeathers trexfeathers self-assigned this Jun 3, 2021
Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Great idea @bjlittle! Some suggestions for you.

@bjlittle bjlittle force-pushed the rationalise-setup branch from bbf0c72 to a9c347b Compare June 4, 2021 07:32
@trexfeathers trexfeathers merged commit d0eab4f into SciTools:master Jun 4, 2021
@bjlittle
Copy link
Member Author

bjlittle commented Jun 4, 2021

@trexfeathers @jamesp Awesome, thanks!

BTW I tested this PR successfully with the following:

  • python setup.py sdist bdist_wheel
  • pip install --no-deps --editable .
  • pip install .
  • pip install .[docs]
  • pip install .[test]
  • pip install .[docs,test]
  • pip install .[all]

@bjlittle bjlittle deleted the rationalise-setup branch June 4, 2021 10:54
tkknight added a commit to tkknight/iris that referenced this pull request Jun 4, 2021
* master:
  refactor setup.py to setup.cfg (SciTools#4168)
  update docs pypi release (SciTools#4173)
  Update CI environment lockfiles (SciTools#4137)
  update CONTRIBUTING.md (SciTools#4165)
  RTD support link update (SciTools#4166)
  drop py36 support (SciTools#4163)
  github issues contact link for discussions (SciTools#4164)
  Bump black version (SciTools#4162)
  Stop CI from clobbering commits on lockfile updates (SciTools#4157)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4161)
  Add a method to return a CubeList from CubeList.copy() (SciTools#4094)
  Update black et al (SciTools#4155)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants