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

Support for pyproject.toml #228

Merged
merged 3 commits into from
Jun 12, 2023
Merged

Support for pyproject.toml #228

merged 3 commits into from
Jun 12, 2023

Conversation

why-not-try-calmer
Copy link
Contributor

@why-not-try-calmer why-not-try-calmer commented Jun 9, 2023

Adding support for pyproject.toml files

  • pyproject.toml are becoming the standard nowadays for packaging Python applications so I felt it would be nice to offer that
  • did some DRY-cleaning, moving the logic initializing the argparse Parameters to a stand-alone top level function; it could be an instance method of Parameters too, it's easy to refactor from one to the other
  • added tests leveraging the two aforementioned changes
  • reduced time complexity when collecting metadata
  • sprinkled some type hints here and there.

@why-not-try-calmer why-not-try-calmer added enhancement New feature or request python Pull requests that update Python code labels Jun 9, 2023
@3nids
Copy link
Member

3nids commented Jun 12, 2023

@why-not-try-calmer thanks a lot for this contribution!
This sounds good to me.

@Gustry @Guts ok for you?
If we decide to move to a version 2.x, I'd rather keel the .qgis-plugin-ci.yaml and completely move to pyproject.toml. Any thoughts?

@Gustry
Copy link
Collaborator

Gustry commented Jun 12, 2023

LGTM, thanks :)

If we decide to move to a version 2.x, I'd rather keel the .qgis-plugin-ci.yaml and completely move to pyproject.toml. Any thoughts?

Fine for me, I have never used it :)

@Guts
Copy link
Collaborator

Guts commented Jun 12, 2023

Good move!

@Gustry @Guts ok for you? If we decide to move to a version 2.x, I'd rather keel the .qgis-plugin-ci.yaml and completely move to pyproject.toml. Any thoughts?

If the setup.cfg section is still supported it's fine to me. I've never used the .qgis-plugin-ci.yaml file.

@why-not-try-calmer
Copy link
Contributor Author

why-not-try-calmer commented Jun 12, 2023

Good move!

@Gustry @Guts ok for you? If we decide to move to a version 2.x, I'd rather keel the .qgis-plugin-ci.yaml and completely move to pyproject.toml. Any thoughts?

If the setup.cfg section is still supported it's fine to me. I've never used the .qgis-plugin-ci.yaml file.

The setup.cfg is still supported as per this PR.

Copy link
Collaborator

@Gustry Gustry left a comment

Choose a reason for hiding this comment

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

You need to add this new configuration option in docs/configuration/options.md

@why-not-try-calmer why-not-try-calmer force-pushed the support-pyproject branch 2 times, most recently from 95b078e to d002c66 Compare June 12, 2023 14:15
@Gustry
Copy link
Collaborator

Gustry commented Jun 12, 2023

In the documentation in the MD file, I meant mainly line 6 at the top of the file.

Thanks @why-not-try-calmer

@why-not-try-calmer
Copy link
Contributor Author

why-not-try-calmer commented Jun 12, 2023

In the documentation in the MD file, I meant mainly line 6 at the top of the file.

Thanks @why-not-try-calmer

Done.

Independently of this PR I'd suggest suffixing text files that meet a specific format (i.e. .qgis-plugin-ci -> .qgis-plugin-ci.yml).

- pyproject.toml are becoming the standard nowadays for packaging Python applications so I felt it would be nice to have.
- did some DRY-cleaning, moving the logic initializing the argparse Parameters to a stand-alone top level function. It could be an instance method of Parameters too, it's easy to refactor from  one to the other.
- added tests leveraging the two aforementioend changes
- reduced time complexity when collecting metadata
- sprinkled some type hints here and there

README

---

collecting metadata: O(n) from O(n^2)
@why-not-try-calmer why-not-try-calmer merged commit 99cec4e into master Jun 12, 2023
@why-not-try-calmer why-not-try-calmer deleted the support-pyproject branch June 12, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants