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

Add isort to organize dependency imports #1959

Merged
merged 5 commits into from
Aug 10, 2023
Merged

Add isort to organize dependency imports #1959

merged 5 commits into from
Aug 10, 2023

Conversation

natestemen
Copy link
Member

@natestemen natestemen commented Aug 9, 2023

Description

This PR adds isort as a dependency. isort is short for "import sort" and sorts dependencies (both alphabetically in each import statement, and groups them according to standard library -> 3rd party -> 1st party imports) in each python file. In addition this PR adds isort to run both as part of CI via the makefile and adds config for it to run properly in our pyproject.toml file.

Motivation

I've made some version of this comment more than twice now, so easiest just to automate away the conversation!

@github-actions
Copy link

github-actions bot commented Aug 9, 2023

Binder 👈 Launch a binder notebook on branch unitaryfund/mitiq/nts-isort

@natestemen natestemen added the dependencies Pull requests that update a dependency file label Aug 9, 2023
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #1959 (9416d1b) into master (06f82af) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1959   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files          83       83           
  Lines        3869     3873    +4     
=======================================
+ Hits         3807     3811    +4     
  Misses         62       62           
Files Changed Coverage Δ
mitiq/benchmarks/ghz_circuits.py 100.00% <ø> (ø)
mitiq/benchmarks/qpe_circuits.py 100.00% <ø> (ø)
mitiq/benchmarks/mirror_circuits.py 98.50% <100.00%> (ø)
mitiq/benchmarks/mirror_qv_circuits.py 100.00% <100.00%> (ø)
mitiq/benchmarks/quantum_volume_circuits.py 100.00% <100.00%> (ø)
mitiq/benchmarks/randomized_benchmarking.py 95.00% <100.00%> (ø)
mitiq/benchmarks/w_state_circuits.py 100.00% <100.00%> (ø)
mitiq/calibration/calibrator.py 98.18% <100.00%> (ø)
mitiq/calibration/settings.py 99.43% <100.00%> (ø)
mitiq/cdr/_testing.py 69.23% <100.00%> (ø)
... and 42 more

@natestemen natestemen changed the title Add isort to sort dependencies Add isort to organize dependency imports Aug 10, 2023
Copy link
Member

@andreamari andreamari left a comment

Choose a reason for hiding this comment

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

Cool!

@natestemen natestemen merged commit 7a6e39d into master Aug 10, 2023
@natestemen natestemen deleted the nts-isort branch August 10, 2023 18:13
@Misty-W Misty-W added this to the 0.29.0 milestone Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants