pennylane icon indicating copy to clipboard operation
pennylane copied to clipboard

Update setup process

Open maliasadi opened this issue 3 years ago • 1 comments

Before submitting

Please complete the following checklist when submitting a PR:

  • [X] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the test directory!

  • [X] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running make docs.

  • [X] Ensure that the test suite passes, by running make test.

  • [ ] Add a new entry to the doc/releases/changelog-dev.md file, summarizing the change, and including a link back to the PR.

  • [X] The PennyLane source code conforms to PEP8 standards. We check all of our code against Pylint. To lint modified files, simply pip install pylint, and then run pylint pennylane/path/to/file.py.

When all the above are checked, delete everything above the dashed line and fill in the pull request template.


Context: This makes PennyLane conform to PEP 517 and PEP 518 with

  • Updating setup.py (and replacing it with setup.cfg)
  • Adding pyproject.toml

These changes also let us to use

  • pip install instead of setup.py install and
  • python -m build instead of setup.py sdist and setup.py bdist_wheel.

As all direct invocations of setup.py are/will effectively deprecated, we should avoid using setup.py for build frontend. A good read about the reasons can be found here: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html.

Not suggested for v0.24.0 It's necessary to get enough feedback beforehand.

Description of the Change: The main changes,

  • Add setup.cfg and pyproject.toml.
  • Remove setup.py.
  • Update GH workflows.
  • Update plugin document.

Possible Drawbacks: n/a

maliasadi avatar Jun 06 '22 13:06 maliasadi

Hello. You may have forgotten to update the changelog! Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

github-actions[bot] avatar Jun 06 '22 13:06 github-actions[bot]

This was an early investigation into the use of pyproject.toml for PL installation. This PR will be closed for now, but can be revisited when PennyLane is made PEP 517 / 518 compliant.

trbromley avatar Nov 28 '23 15:11 trbromley