Python PEP440 implementation in JavaScript.
This logic has been ported from Python for the purposes of use in Renovate Bot.
License: Other
Python PEP440 implementation in JavaScript.
This logic has been ported from Python for the purposes of use in Renovate Bot.
In the file lib/specifier.d.ts
The functions maxSatisfyingVesrion
and minSatisfyingVersion
, the parameter version
have type string
which needs to be of type string[]
and renamed to versions
.
What would you like to be able to do?
We should use the node install action buildin cache like in other repos
Did you already have any implementation ideas?
Use same code as in other repo's
What would you like to be able to do?
Right now we need to manually format the code. This is a bad idea.
Did you already have any implementation ideas?
prettier-fix
command in the scripts
in package.json
main
and incoming Pull RequestYou can probably copy/paste/adjust the relevant Prettier scripts and CI setup from the main Renovate repository.
In semver, we have major/minor/patch and we also use "pin" (go from range to exact version). Default behaviour is to not treat patch differently so instead classify updates as major or minor. We don't use a special name for updates like 1.2.3-alpha.1 -> 1.2.3-alpha.2, these would end up being called "minor" or "patch".
In Docker we also have "digest" updates - updating the sha256 digest.
PEP440 prefers major.minor.micro where micro=patch. They also have additional parts, e.g. dev, post or pre releases.
Decision:
Also:
What would you like to be able to do?
We use this package in renovate
and due to absence of types.ts
file we will have to create a .d.ts
file there to declare the module as per typescript rules when strictNullCheck is true
.
Image:-
Did you already have any implementation ideas?
We can add types.ts
file here and declare the types in that file.
I have not written a types.ts
file in past but I am learning TS and am interested in implementing the solution.
Add additional support to the inc
function to increment versions using the release types premajor
, preminor
, prepatch
, and prerelease
.
These additional release types will mirror similar support in the node-semver
package.
Export a function that takes two arguments; a version followed by a release type.
The version argument must be a valid PEP440 version, while the second argument, release type, must be one of major
, minor
, or patch
.
This function will provide similar support to the node-semver
package, but without support for pre-releases (as supported by node-semver
), or other components of the PEP440 specification.
Support for pre-releases will be a follow-up enhancement.
I plan on implementing this in the following days.
Pre-existing Python package for version incrementing:
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These branches will be created by Renovate only once you click their checkbox below.
eslint
, eslint-plugin-jest
)These updates are awaiting their schedule. Click on a checkbox to get an update now.
.github/workflows/build.yml
actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
actions/upload-artifact v4.3.3@65462800fd760344b1a7b4382951275a0abb4808
codecov/codecov-action v4.5.0@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
actions/checkout v4.1.7@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
package.json
conventional-changelog-conventionalcommits 7.0.2
eslint 8.57.0
eslint-config-prettier 9.1.0
eslint-formatter-gha 1.5.0
eslint-plugin-import 2.29.1
eslint-plugin-jest 27.9.0
eslint-plugin-promise 6.2.0
husky 9.0.11
jest 29.7.0
lint-staged 15.2.7
markdownlint-cli2 0.13.0
npm-run-all2 6.2.0
prettier 3.3.2
prettier-plugin-packagejson 2.5.0
semantic-release 23.1.1
node ^18.12.0 || >= 20.0.0
pnpm ^8.6.11
pnpm 8.15.8
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
Rename parsed
type to Pep440Version
.
Originally posted by @viceice in #115 (comment)
What would you like to be able to do?
Remove these exportes, as they aren't easily usable via esm imports
Lines 12 to 18 in 5fb26d3
Did you already have any implementation ideas?
Simply remove them. Probably breaking.
What would you like to be able to do?
All declared functions in index.d.ts
should be removed and replaced by the relevant exports from lib.
Did you already have any implementation ideas?
yes
What would you like to be able to do?
We should remove xregexp
dependency, as there is no used benefit. We can maybe use RE2
?
It looks like xregexp
was added in old node v10 ages and is no longer required.
Did you already have any implementation ideas?
yes, simply use normal RegExp
class.
We probably need the equivalent functions as in https://github.com/renovateapp/renovate/blob/master/lib/util/semver.js
Options:
I think we want to avoid (3) due to the amount of work required.
I noticed this repo has a travis.yml
file, that's outdated (it uses Node 8).
Should we maybe migrate this to a GitHub Actions workflow and update the Node version?
This repository also doesn't explain in the README what the goal of this repo is, so anybody reaching this repo can't see if they need this or not.
Also it would be nice to have a badge for the tests on the README page, so that you can see at a glance if tests are passing/failing.
Describe the bug
It appears that this implementation doesn't fully like pre-release versions.
WARN: pep440: failed to calculate newValue
{
"result": "~=0.1.dev748+g3349dad",
"newVersion": "0.1.dev748+g3349dad",
"currentValue": "~=0.1.dev0"
}
Steps to reproduce
> satisfies("0.1.dev748+g3349dad", "~=0.1.dev748+g3349dad")
false
> satisfies("0.1.dev748+g3349dad", "==0.1.dev748+g3349dad")
true
Ansible uses a lot of four-part versions for example: https://pypi.org/project/ansible/#history
e.g. 2.3.1.0
Also GitHub's vulnerability alerts tend to use four-part versions for PIP, which makes it even more important.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.