-
Notifications
You must be signed in to change notification settings - Fork 120
chore: add GH actions, PDM, package, publish to Pypi #29
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
Conversation
laluka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely work, tons of new things I'm not too familiar with yet (gitlab CI fan, gha is somewhat different..)!
A few questions, a few neats, maybe some "onboarding time" for the two of us, and another approval from @jtof-fap and we'll merge this one for sure, thanks for the hard/smart work! 💟
| with: | ||
| cache: true | ||
| python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, the same as actions/setup-python | ||
| architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add x86 & arm 32/64 from the first release, for mac MX users ? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it, as our code is pure Python it is universal. We could expand the architecture/OS matrix if we want, but as there are no tests yet it would not be useful.
The Docker image is arch specific, but already has amd64 and arm64 as targets.
| python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, the same as actions/setup-python | ||
| architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python | ||
| version: ${{ matrix.pdm-version }} # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub | ||
| allow-python-prereleases: true # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fall back to 3.12-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe false to only drive efforts to true releases ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you want, I saw that the Docker image was using 3.13, so I thought it was a good idea!
Building and testing against future versions of Python should not be a huge issue, as there are not many dependencies and it's a pure Python package.
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "The version to tag, without the leading 'v'. If omitted, will initiate a dry run (no uploads)." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we buildon every push, and deploy release on specific tag vX.Y.Z ? Any keyword to specify ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we have a CI for each commit/PR, and the release one on manual trigger.
Just have to trigger the CD action with the tag to create e.g. 0.4.0 or 0.4.0alpha1 and it will deploy to Pypi, Github Release, create the Git tag, and push a Docker image to Github Registry.
| @@ -1,5 +1,7 @@ | |||
| # Bypass Url Parser | |||
|
|
|||
| [](https://pypi.org/project/bypass-url-parser/) [](https://pypi.org/project/bypass-url-parser/) [](https://github.com/laluka/bypass-url-parser/blob/main/LICENSE) [](https://pdm.fming.dev) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌹
| ] | ||
|
|
||
| [[tool.pdm.autoexport]] | ||
| filename = "requirements.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-export, so should we remove from git & add to gitignore requirements*.txt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it in VCS to allow users without PDM to install or edit the package with a simple clone. If you feel that's too much, I'd be glad to removed the requirements*.txt and the PDM plugin.
| if self.save_level >= self.SaveLevel.PERTINENT: | ||
| json_file = f"{outdir}{Tools.SEPARATOR}{Bypasser.DEFAULT_JSON_FILENAME}" | ||
| with open(json_file, mode="wt", encoding=self.encoding) as file: | ||
| with open(json_file, mode="w", encoding=self.encoding) as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to check that this doesn't introduct breaking changes.. 😅
And test that though installs from pdm, pip, pipx.. X_X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, all changes in this file should be safe, they were produced by ruff, sorry for the noise 😅
Only manual changes are in load_file_into_memory_list
|
In call with @GabDug , merging now to troubleshoot live if needed :) |
1 similar comment
|
In call with @GabDug , merging now to troubleshoot live if needed :) |

Hey! Quick MR, mostly about packaging, CI and a few Python simplifications. Non exhaustive overview:
CI
ci.ymlrelease.ymlwhland `tar.gz)sync_python_deps.ymlPackaging
pyproject.tomlREADME
./bypass-url-parsertobypass-url-parserFurther improvements
pre-cmmot.ci?