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

[AT-4082] Configure pylint for catalog #549

Merged
merged 24 commits into from
Mar 6, 2024
Merged

Conversation

seedlit
Copy link
Contributor

@seedlit seedlit commented Mar 4, 2024

Jira ticket here.

Scope:

  • Fixes catalog.py and test_catalog.py for pylint

NOTES:

  • I had to make some changes in other files as well because of renaming a function name
  • We have to be careful with this release since I have renamed a function --> this might be a breaking change
  • most lines of changes are coming from poetry.lock file
  • I did not change the max line length setting to 79 yet as this will need changes in multiple files. Will make a separate PR for that.

Items:

  • Ran test & live-tests
  • Implemented (new) unit tests
  • Removed credentials
  • Removed argument pointing to staging
  • Updated documentation

For release:

  • Bumped version
  • Added changelog
  • Updated announcement banner

@@ -30,6 +30,12 @@ You can check your current version with the following command:

For more information, see [UP42 Python package description](https://pypi.org/project/up42-py/).

## 0.37.0a0
Copy link
Contributor

Choose a reason for hiding this comment

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

check the order of merging as the other PR has the same version bump

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll address that in my PR if this is merged earlier

Copy link
Contributor Author

@seedlit seedlit Mar 6, 2024

Choose a reason for hiding this comment

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

I updated it to 0.37.0a1

@@ -1,19 +1,18 @@
import json
import os
import pathlib
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for curiosity, Why did we make this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

Google style code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pylint-google-style-guide-imports-enforcing = "^1.3.0"

@andher1802
Copy link
Contributor

I check on the surface. Although I found it OK, I will leave the approval for @javidq.
However, I have two comments:

  1. Usually I try to get 100% coverage for new code in every PR to not add more uncovered lines. This one changed 2 lines on catalog that are not covered by testing. Maybe adding test for catalog repr and the search with json features set to false would be nice if you think is OK.
  2. Most of the changes were introduced at the import convention. Just for my own education, why some of them removed from x import y, and why some were left that way. Is there a rule that we are following or pylint enforces?

It LGTM. good job @seedlit , this one is a massive change. :)

pylintrc Outdated
max-line-length=120

# Maximum number of characters on a single line.
max-line-length=150
Copy link
Contributor

Choose a reason for hiding this comment

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

We actually need to decrease, not increase

Copy link
Contributor

Choose a reason for hiding this comment

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

@seedlit this suggestion led to explosive growth of the PR and also security gate now fails due to coverage, let's just keep it 120 as it was and let's add a ticket to address it later separately. Sorry for confusion and unneeded work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will create a ticket.
Although I find it surprising that coverage got reduced just because of this setting.
Doesn't makes much sense 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@javidq javidq Mar 6, 2024

Choose a reason for hiding this comment

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

It reduced because it basically checked all files, so now it shows the coverage of the whole SDK

.pre-commit-config.yaml Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
@@ -1,19 +1,18 @@
import json
import os
import pathlib
Copy link
Contributor

Choose a reason for hiding this comment

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

Google style code

tests/test_catalog.py Outdated Show resolved Hide resolved
@@ -30,6 +30,12 @@ You can check your current version with the following command:

For more information, see [UP42 Python package description](https://pypi.org/project/up42-py/).

## 0.37.0a0
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll address that in my PR if this is merged earlier

up42/tasking.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
up42/catalog.py Outdated Show resolved Hide resolved
tests/test_catalog.py Outdated Show resolved Hide resolved
tests/test_catalog.py Outdated Show resolved Hide resolved
tests/test_catalog.py Outdated Show resolved Hide resolved
tests/test_catalog.py Outdated Show resolved Hide resolved
tests/test_catalog.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Mar 6, 2024

@seedlit
Copy link
Contributor Author

seedlit commented Mar 6, 2024

@dustgalactic I pushed your suggested changes.
I will merge this PR. If you have any other suggestions, I can tackle that in upcoming PRs

@seedlit seedlit merged commit 9747d52 into master Mar 6, 2024
3 checks passed
@seedlit seedlit deleted the configure_pylint_for_catalog branch March 6, 2024 16:34
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