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

Be able to load a profile from an external package #604

Merged
merged 1 commit into from Mar 27, 2023

Conversation

sbrunner
Copy link
Contributor

@sbrunner sbrunner commented Mar 20, 2023

Description

Add the possibility to use a profile shared throw a Python package.

Related Issue

Fix #459.

Motivation and Context

Be able to share a profile between different projects.

How Has This Been Tested?

  • I create a package with a profile (https://github.com/sbrunner/prospector-profile-duplicated)
  • I created a .prospector.yamlconfiguration file that uses this profile
  • Verify that we have:
    • The default configuration
    • The profile configuration (new)
    • The project configuration (from .prospector.yaml file)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My change requires a change to the dependencies
  • I have updated the dependencies accordingly
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sbrunner
Copy link
Contributor Author

Should add a package to be able to write unit tests?

@Pierre-Sassoulas Pierre-Sassoulas added this to the 1.10.0 milestone Mar 20, 2023
@sbrunner sbrunner force-pushed the profile branch 5 times, most recently from bb51f25 to af9a009 Compare March 21, 2023 08:54
@sbrunner sbrunner marked this pull request as ready for review March 21, 2023 09:03
@sbrunner
Copy link
Contributor Author

@Pierre-Sassoulas for me, it's ready to be reviewed, thanks :-)

Copy link
Collaborator

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

I have a small nitpick, and it looks pretty good imo (I might use this for other packages). I think for this kind of big design decision a review by @carlio is required though.

prospector/config/__init__.py Show resolved Hide resolved
prospector/config/__init__.py Outdated Show resolved Hide resolved
@sbrunner
Copy link
Contributor Author

Thanks @Pierre-Sassoulas

@carlio
Copy link
Member

carlio commented Mar 27, 2023

All looks good to me :-)

I'd suggest putting a prospector-profile-example project on PyPI too perhaps, to demonstrate how it could be used and to add documentation pointing to it, however that could be a separate PR, I'm happy to merge this now.

@carlio carlio merged commit de222a9 into landscapeio:master Mar 27, 2023
6 checks passed
@sbrunner
Copy link
Contributor Author

Thanks for the merge :-)
How should we continue?
I can't create a repository on prospector-profile-example, in the documentation we can also point to the tested profile https://github.com/PyCQA/prospector/tree/master/tests/prospector-profile-test
Is it also possible to have an alpha version on pypi to be able to make test in real condition?

@sbrunner sbrunner deleted the profile branch March 27, 2023 08:15
@carlio
Copy link
Member

carlio commented Mar 27, 2023

You could test it by using a git dependency instead of pypi, do pip install git+https://github.com/PyCQA/prospector@master or something,

@carlio
Copy link
Member

carlio commented May 12, 2023

Hi there, I got distracted, sorry about that. Prospector 1.10.0 is on PyPI now with this in it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Shareable profile
3 participants