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

new version-mode option for monorepo versioning #496

Open
dlqqq opened this issue Mar 6, 2023 · 1 comment
Open

new version-mode option for monorepo versioning #496

dlqqq opened this issue Mar 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dlqqq
Copy link

dlqqq commented Mar 6, 2023

Problem

Right now, bump-version only offers one "versioning mode", a strategy to bump versions of all packages underneath the repository: running version-cmd inside of every Python package. Let us call this versioning mode per-python.

In monorepos such as Jupyter AI, we are using a single script that allows all package versions to be bumped with a single invocation run from the monorepo root. Without more configurability, the current behavior of Jupyter Releaser wastefully runs version-cmd for every Python package under the monorepo, rather than just running it once from the root.

Proposed Solution

Add a new version-mode option that allows two values: per-python and monorepo.

  • version-mode is respected first. If set to per-python, it will ignore monorepo-specific options, and vice versa.

    • python_packages is a per-python version mode specific option, and will be ignored if version-mode is set to monorepo.
    • There are currently no monorepo specific options I suggest.
  • When version-mode is set to per-python, the existing behavior is preserved.

  • When version-mode is unspecified, we default to per-python.

  • When version-mode is set to monorepo, then we only run version-cmd once at the repository root.

This proposal is also easily extensible. For example, if users wanted to run a command per Yarn workspace instead of per declared Python package, the solution would just involve adding a new versioning mode and its implementation.

Additional context

We are currently using lerna version to bump the NPM package versions and it works fairly well, though it has a lot of quirks. The killer feature is that it bumps versions of intra-monorepo dependencies. We're using hatch-nodejs-version to dynamically link the Python package version to the NPM package version.

@dlqqq dlqqq added the enhancement New feature or request label Mar 6, 2023
@jtpio
Copy link
Member

jtpio commented Mar 7, 2023

Maybe another approach would be to remove python_packages but still use version-cmd to bump the version (and have full control on it).

And use a custom script to build the Python packages and place them in the dist folder, so they can be picked up by the releaser in the next steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants