Code Monkey home page Code Monkey logo

pep440's Introduction

pep440

build codecov

Python PEP440 implementation in JavaScript.

This logic has been ported from Python for the purposes of use in Renovate Bot.

pep440's People

Contributors

churro avatar dependabot[bot] avatar dimastebaev avatar honkinggoose avatar hutson avatar kayoub5 avatar rahulgautamsingh avatar rarkins avatar renovate-bot avatar renovate[bot] avatar viceice avatar zharinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pep440's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • chore(deps): update linters (major) (eslint, eslint-plugin-jest)
  • chore(deps): update pnpm to v9
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update pnpm to v8.15.8

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4.1.4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
  • actions/upload-artifact v4.3.3@65462800fd760344b1a7b4382951275a0abb4808
  • codecov/codecov-action v4.3.1@5ecb98a3c6b747ed38dc09f787459979aebb39be
  • actions/checkout v4.1.4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
  • actions/checkout v4.1.4@0ad4b8fadaa221de15dcec353f45205ec38ea70b
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
npm
package.json
  • conventional-changelog-conventionalcommits 7.0.2
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-formatter-gha 1.4.3
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jest 27.9.0
  • eslint-plugin-promise 6.1.1
  • husky 9.0.11
  • jest 29.7.0
  • lint-staged 15.2.2
  • markdownlint-cli2 0.13.0
  • npm-run-all2 6.1.2
  • prettier 3.2.5
  • prettier-plugin-packagejson 2.5.0
  • semantic-release 23.0.8
  • node ^18.12.0 || >= 20.0.0
  • pnpm ^8.6.11
  • pnpm 8.15.7

  • Check this box to trigger a request for Renovate to run again on this repository

Remove strange string exports

What would you like to be able to do?

Remove these exportes, as they aren't easily usable via esm imports

pep440/lib/operator.js

Lines 12 to 18 in 5fb26d3

"<": lt,
"<=": le,
"==": eq,
"!=": ne,
">=": ge,
">": gt,
"===": arbitrary,

Did you already have any implementation ideas?

Simply remove them. Probably breaking.

incorrect type of function parameters

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.

Remove `xregexp` and use build-in `RegExp`

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.

/cc @RahulGautamSingh

Action Required: Fix Renovate Configuration

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.

Problems with pre-release identifiers

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

Declare types for this package.

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:-
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.

ideas/questions for this repo

Migrate to GitHub Actions?

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?

Explain what this repo is about in readme?

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.

Add badges for migrated GitHub Action?

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.

pep440 upgrade types

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:

  • force existing "patch" terminology on python? e.g. how we force PR even though GitLab uses MR
  • support "micro" in configuration and alias it to patch?

Also:

  • Need to explicitly support terminology for other update types? doesn't look like it

Refactor ci to use node install buildin cache

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

Major/Minor/Patch Support

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:

Setup Prettier linter

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?

  • Install Prettier as development dependency
  • Include a prettier-fix command in the scripts in package.json
  • Run a prettier lint command in the CI on pushes to main and incoming Pull Request

You can probably copy/paste/adjust the relevant Prettier scripts and CI setup from the main Renovate repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.