Update setup process
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.mdfile, 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 runpylint 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 withsetup.cfg) - Adding
pyproject.toml
These changes also let us to use
-
pip installinstead ofsetup.py installand -
python -m buildinstead ofsetup.py sdistandsetup.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.cfgandpyproject.toml. - Remove
setup.py. - Update GH workflows.
- Update plugin document.
Possible Drawbacks: n/a
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.
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.