Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor setup.py to align with CF. #450

Merged
merged 64 commits into from
Jun 21, 2023
Merged

Refactor setup.py to align with CF. #450

merged 64 commits into from
Jun 21, 2023

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented May 18, 2023

Before submitting

Please complete the following checklist when submitting a PR:

  • 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
    tests directory!

  • 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.

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

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

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


Context:
The way setup.py is written, it tries to find binaries in the environment (for MacOS in particular) and it may override some CMake decisions which would actually make sense in some build environments (e.g. on Conda-Forge). This is trying to apply this patch and a bit more.

Description of the Change:
Remove (most of ) CMake argument parsing from setup.py. Adapt CI files and use env: when possible to set environment variables.

Benefits:
Where necessary, libraries and default build tools are defined declaratively in the Actions files. setup.py is simplified and any CMake argument can be passed in CMAKE_ARGS if required. This complies better with Conda-Forge, and hence we'll be able to remove some patches there.

Possible Drawbacks:
Building from source may change a bit for users used to do so.

Related GitHub Issues:
PR 58

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #450 (fb5cb7d) into master (a83875a) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #450      +/-   ##
==========================================
+ Coverage   99.76%   99.82%   +0.06%     
==========================================
  Files          42       50       +8     
  Lines        3811     4667     +856     
==========================================
+ Hits         3802     4659     +857     
+ Misses          9        8       -1     
Impacted Files Coverage Δ
pennylane_lightning/_version.py 100.00% <100.00%> (ø)

... and 41 files with indirect coverage changes

@vincentmr vincentmr marked this pull request as ready for review May 18, 2023 21:42
Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

Some suggestions.

.github/CHANGELOG.md Outdated Show resolved Hide resolved
.github/workflows/tests_linux.yml Outdated Show resolved Hide resolved
.github/workflows/tests_linux.yml Outdated Show resolved Hide resolved
.github/workflows/tests_linux.yml Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @vincentmr
Just a few thoughts and comments

.github/workflows/tests_linux.yml Outdated Show resolved Hide resolved
.github/workflows/wheel_linux_aarch64.yml Outdated Show resolved Hide resolved
.github/workflows/wheel_linux_x86_64.yml Outdated Show resolved Hide resolved
.github/workflows/wheel_macos_arm64.yml Outdated Show resolved Hide resolved
.github/workflows/wheel_macos_x86_64.yml Outdated Show resolved Hide resolved
.github/workflows/wheel_macos_x86_64.yml Outdated Show resolved Hide resolved
.github/workflows/wheel_win_x86_64.yml Outdated Show resolved Hide resolved
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @vincentmr

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@vincentmr vincentmr merged commit 1856f47 into master Jun 21, 2023
@vincentmr vincentmr deleted the cf/setup_py branch June 21, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants