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

[STYLE] Drop python 3.7, linting applied and improvements of it #96

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

Mildophin
Copy link
Collaborator

@Mildophin Mildophin commented Jul 11, 2023

This MR is mostly about linting following my previous MR as it wasn't applied correctly. This MR also includes the changes of #88, with some updates of the linting dependencies, the files of the CI and pre commit hooks. There are few things I forgot to change in my last MR, so this version patch them.

The MR is a fork of the following one: #95 (you find some comments from aleksander on it)

@Mildophin Mildophin marked this pull request as ready for review July 11, 2023 13:24
"flake8-import-order==0.18.1",
"black==23.3.0",
"flake8==6.0.0",
"isort==5.12.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's the main part to have a look at, for consistency I used isort and dropped flake8 import order (btw it was not triggered at all)

I did not update mypy because many parts of the code were triggering errors, and they seemed a little bit time consuming to solve, also I think that using pyright instead would be good for consistency with the public APIs.

@Mildophin Mildophin changed the title [CONF/CI/STYLE] Drop python 3.7 + Linting improvements and applied [CONF/CI/STYLE] Drop python 3.7, linting applied and improvements of it Jul 11, 2023
hooks:
- id: autoflake
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: setup.py
language_version: python3.11
exclude: ^sdk/
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to prevent non used imports errors being raised

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds like this should be handled from the flake8 config instead

@@ -20,7 +20,12 @@
from pasqal_cloud.batch import Batch, RESULT_POLLING_INTERVAL
from pasqal_cloud.client import Client
from pasqal_cloud.device import BaseConfig, EmulatorType
from pasqal_cloud.endpoints import AUTH0_CONFIG, Auth0Conf, Endpoints, PASQAL_ENDPOINTS
from pasqal_cloud.endpoints import ( # noqa: F401
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as the endpoints and auth0 config is not used directly here but imported by the users, using the noqa flag prevent flake8 errors

@Mildophin Mildophin changed the title [CONF/CI/STYLE] Drop python 3.7, linting applied and improvements of it [STYLE] Drop python 3.7, linting applied and improvements of it Jul 11, 2023
@Mildophin Mildophin self-assigned this Jul 11, 2023
Copy link
Collaborator

@MatthieuMoreau0 MatthieuMoreau0 left a comment

Choose a reason for hiding this comment

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

lgtm, two small comments

hooks:
- id: autoflake
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
exclude: setup.py
language_version: python3.11
exclude: ^sdk/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds like this should be handled from the flake8 config instead

@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.3.3"
__version__ = "0.3.4"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this warrants a version bump tbh

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright, I had a doubt regarding the python version dependency

@Mildophin Mildophin force-pushed the mv/drop-python37-and-improve-linting-checks branch from e5b0b60 to aa49aec Compare July 11, 2023 14:27
@Mildophin Mildophin merged commit 3f73028 into dev Jul 12, 2023
5 checks passed
@Mildophin Mildophin deleted the mv/drop-python37-and-improve-linting-checks branch July 12, 2023 07:48
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.

2 participants