acsone / manifestoo-core

A library to reason about Odoo addons manifests.
MIT License
8 stars 7 forks source link

underscores in distribution name #68

Closed hparfr closed 4 months ago

hparfr commented 4 months ago

Hi @sbidoul

I have some issues on a non-OCA repo where the ci is trying to install modules like "odoo14-addon-shopinvader_delivery_carrier" instead of "odoo14-addon-shopinvader-delivery-carrier"

I see there is no replace("_","-") in addon_name_to_distribution_name.

I don't get it why it works in OCA, and what I'm missing.

sbidoul commented 4 months ago

Hi @hparfr

Both form work. Try for instance pip install --dry-run --no-deps odoo14-addon-shopinvader_delivery_carrier.

What problem do you observe?

hparfr commented 4 months ago

Thanks !

I remember having issues with pip install odoo14-addons-names_with_underscores . But yes, I see now both are accepted by pip :)

In fact, the real problem was the index:

pip install --dry-run --no-deps odoo14-addon-shopinvader
Looking in indexes: https://wheelhouse.odoo-community.org/oca-simple-and-pypi
ERROR: Could not find a version that satisfies the requirement odoo14-addon-shopinvader (from versions: none)
ERROR: No matching distribution found for odoo14-addon-shopinvader
sbidoul commented 4 months ago

Ah, yes, that's the special index OCA uses to make sure it uses only OCA addons in tests, and does not pull other non-OCA addons from PyPI.

hparfr commented 4 months ago

I just discovered its existence :)

Thanks for your help.

I just did an copier copy gh:oca/oca-addons-repo-template . --trust in some repo in hope to do the minimum changes as possible :)

sbidoul commented 4 months ago

This is controlled with the PIP_INDEX_URL environment variable of the oca-ci image.

sbidoul commented 4 months ago

So you can set PIP_INDEX_URL=https://pypi.org/simple/ to use regular PyPI, for instance.

hparfr commented 4 months ago

I did a small edit in .github/workflows/test.yml


  test:
    runs-on: ubuntu-22.04
    container: ${{ matrix.container }}
    name: ${{ matrix.name }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
            name: test with OCB
            makepot: "false"
+    env:
+      PIP_EXTRA_INDEX_URL: "https://wheelhouse.shopinvader.com/simple/"