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] Create a primer package in 'pylint.testutils' #6905

Merged

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Jun 10, 2022

Type of Changes

Type
βœ“ πŸ› Bug fix
βœ“ ✨ New feature
βœ“ πŸ”¨ Refactoring
βœ“ πŸ“œ Docs

Description

First step to be able to add more testable things related to primer here. I'm wondering if an external package called pylint-testutils wouldn't be better at this point. We don't need to ship test helper in pylint, but pytest do not like import from test file contained in tests. We might remove pylint/testutils in 3.0 and always use bleeding edge of the new package in pylint itself.

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Jun 10, 2022
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt

__all__ = ["PackageToLint", "PRIMER_DIRECTORY_PATH"]
Copy link
Member Author

Choose a reason for hiding this comment

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

The path to the primer directory to not need to be modified because it's relative (PRIMER_DIRECTORY_PATH = Path("tests") / ".pylint_primer_tests")

@DanielNoord
Copy link
Collaborator

I have been thinking about this as well, but let's not do this as long as the primer isn't where we want this to be (parallelisation etc.).

Just giving the list of packages we prime also doesn't make a lot of sense: if anybody would ever want to re-use our primer the first thing they'll likely change is the packages to prime.

@coveralls
Copy link

coveralls commented Jun 10, 2022

Pull Request Test Coverage Report for Build 2473831366

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0005%) to 95.526%

Totals Coverage Status
Change from base Build 2471585025: 0.0005%
Covered Lines: 16354
Relevant Lines: 17120

πŸ’› - Coveralls

@Pierre-Sassoulas
Copy link
Member Author

I think temporarily adding primer's helper in pylint.testutils to be able to test them properly is a decent compromise until they mature and we cleanup, what do you think ? I want to test and modify the primer comment next.

@DanielNoord
Copy link
Collaborator

Hm, then let's do pylint/testutils/_primer/__init__.py etc.

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

To preserve backwards compatibility we might want to keep the old file and re-import there with a warning. However, I don't think there will be many packages that use this so let's not do that πŸ˜„

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the burst-pylint-testutil-primer branch from 44ab3e8 to 9c14297 Compare June 10, 2022 08:43
@Pierre-Sassoulas
Copy link
Member Author

let's not do that

Yeah agree completely πŸ‘ Package maintainers that discovered our primer's helper are big boys and girls, they can change their export. The cleanup we'll have to do for pylint 3.0 is already beyond epic as is πŸ˜„

@github-actions
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 9c14297

@Pierre-Sassoulas Pierre-Sassoulas merged commit 6ebe1cc into pylint-dev:main Jun 10, 2022
@Pierre-Sassoulas Pierre-Sassoulas deleted the burst-pylint-testutil-primer branch June 10, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants