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

uv rspack pnpm web worker ports #383

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

utnapischtim
Copy link
Contributor

@utnapischtim utnapischtim commented Feb 19, 2025

this supersede #380

steps to how to use it

1.) check that uv and pnpm are installed
2.) create a new my-site directory with the regular content as usual OR go into your current development my-site directory
2.a) deactivate the active environment
3.) create with uv a virtual environment with uv venv --prompt uv-env && source .venv/bin/activate
4.) install invenio-cli with uv pip install "git+https://github.com/utnapischtim/invenio-cli@uv-rspack-pnpm-web-worker-ports"
4.a) uv pip install "git+https://github.com/utnapischtim/pynpm@add-pnpm"
5.) copy following text into the .invenio file into the cli section

python_packages_manager = uv
javascript_packages_manager = pnpm
assets_builder = rspack

5.a) please copy following to invenio.cfg

JAVASCRIPT_PACKAGES_MANAGER = "pnpm"
ASSETS_BUILDER = "rspack"

6.) copy following text into the pyproject.toml file. the file should be created beside the invenio.cfg file

[project]
name = "InvenioRDM"
requires-python = ">= 3.12"
dynamic = ["version"]

dependencies = [
  "invenio-app-rdm[opensearch2]~=13.0.0b2.dev2",
  "uwsgi>=2.0",
  "uwsgitop>=0.11",
  "uwsgi-tools>=1.1.1",

  # rspack
  "flask-webpackext",
  "invenio-assets",
  "pywebpack",
  "pynpm",
]

[tool.setuptools]
py-modules = [] # necessary to make the packages with setup.py usable with uv

# overrides packages from "dependencies"
[tool.uv.sources]
flask-webpackext = { git = "https://github.com/utnapischtim/flask-webpackext", branch = "make-ready-for-rspack" }
invenio-assets = { git = "https://github.com/slint/invenio-assets", branch = "rspack" }
pywebpack = { git = "https://github.com/utnapischtim/pywebpack", branch = "add-scripts" }
pynpm = { git = "https://github.com/utnapischtim/pywebpack", branch = "add-pnpm" }

7.) run invenio-cli install to install

utnapischtim and others added 2 commits February 19, 2025 23:17
* since uv uses pyproject.toml relying on Pipfile doesn't work
* handle the detection of the python package manager to be used and the
  generation of its commands in a central spot to lower the maintenance
  burden
* make some commands (like translations) aware of the CLI config, to
  enable using pipenv alternatives too
* also rename packages_manager to package_manager because that's the
  common term
* tell invenio about which JS package manager is actually selected
  currently (npm or pnpm), via the new `ASSETS_NPM_PKG_CLS` config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants