XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
745 stars 187 forks source link

Create a separate requirements file for the CI #629

Closed sduquemesa closed 2 years ago

sduquemesa commented 2 years ago

Context: The requirements.txt file has packages unpinned. This is contrary to the convention of pinning packages in the requirements.txt file.

Description of the Change: Create a separate requirements.txt (pinned) and requirements-ci.txt (unpinned). This latter is used by the CI.

Benefits: CI environment will behave closely as when installing the package with setup.py

Possible Drawbacks: Version conflicts on (unpinned) dependencies potentially will only appear on CI environment.

Related GitHub Issues: #582

codecov[bot] commented 2 years ago

Codecov Report

Merging #629 (e8ae03b) into master (dae6ae8) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #629   +/-   ##
=======================================
  Coverage   98.55%   98.55%           
=======================================
  Files          77       77           
  Lines        8989     8989           
=======================================
  Hits         8859     8859           
  Misses        130      130           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dae6ae8...e8ae03b. Read the comment docs.

sduquemesa commented 2 years ago

@thisac, following the discussion on issues #582, this is the reply from @antalszava:

Yes! The idea would be to only pin only those packages to a certain version in the requirements-ci.txt file where there is a specific constraint (i.e., SF only works with a certain version of the dependency). The rest of the packages would stay unpinned so that when issuing pip install -r requirements-ci.txt, the latest version for each package is installed by the continuous integration check.

In contrast, in the requirements.txt file we would like to provide the user with a working setup to use Strawberry Fields. We provide a list of dependencies with pinned versions, such that by doing pip install -r requirements.txt, they will get a working combination of dependencies and be able to use Strawberry Fields.

thisac commented 2 years ago

Thanks @sduquemesa! We should update the recently merged .github/workflows/upload.yml file to use pip install -r requirements-ci.txt as well, so that we're testing with the same package versions for release. Looks good otherwise! 💯