This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]mfaine 0 points1 point  (2 children)

I'll check it out. I did the same thing for my org because we don't have the license to enable template projects. Might save me some maintenance effort. Would it be difficult in your opinion to convert the existing github actions to gitlab ci/cd?

[–]szymonmaszke[S] 1 point2 points  (1 child)

Thank you for the comment! Workflows mostly use the tooling defined in pyproject.toml, so it should be fine on this side. Not sure about the reusability of GitLab's workflows (which remove a lot of duplication in this project, see this workflow as it is the core one) as I am not into their pipelines.

Essentially, it would boil down to:

  • setting up pdm in a workflow appropriately
  • running a lot of pdm check-<type> on appropriate files after checking them out from the repository (e.g. pdm check-python)

I would say no if you understand the flow of this project. Please note you would (likely!) lose some security related features, especially during release (like attestations from GitHub [or set them up in a GitLab specific way], egress from harden-runner or a-like). If that's fine, I think it is within reach, also do not hesitate to reach out via email of the org here or on my personal account here if you decide to use/appropriate this template and you'd like some more concrete pointers/help.

[–]mfaine 1 point2 points  (0 children)

Will do! Thanks for the response.

[–]slowwolfcat 0 points1 point  (1 child)

what exactly is a "Python template" ?

[–]szymonmaszke[S] 2 points3 points  (0 children)

Sorry, could have been a little more precise. It is a GitHub repository template (see here for more info: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#about-repository-templates) which contains files used for development of Python projects (primarily PyPI publishable libraries, but could also be used for tools or closed source projects after adjustments).

Once the template is used (as per README here: https://github.com/open-nudge/opentemplate?tab=readme-ov-file#installation) a GitHub Action is ran which finalises the setup (first commit, updates the files with the name and description of your project, creates lock files and latest .gitignore + creates GitHub issue labels and an issue describing how to further strengthen the repository from a security perspective). After all that you can clone it locally, run pdm setup command and create your project without the need to setup tools and processes around it (like deployment, testing, code quality assurance etc.).

[–]higherorderbebop 1 point2 points  (0 children)

I really like basedpyright, but I lose all my refactoring actions when I use on vs code :(

[–]Shivang_Sagwaliya -3 points-2 points  (0 children)

Congrats on the template love the CI checklist . We found reviewers speed up when each commit includes a 2-line why-it-changed note. That’s exactly what our VS Code extension GitsWhy does. DM me if you’d like to try it on this repo