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

[WIP] Algorithm to obtain metadata from an addon name #10

Open
sbidoul opened this issue Nov 16, 2024 · 4 comments
Open

[WIP] Algorithm to obtain metadata from an addon name #10

sbidoul opened this issue Nov 16, 2024 · 4 comments

Comments

@sbidoul
Copy link
Member

sbidoul commented Nov 16, 2024

I will describe here a possible algorithm to obtain the metadata from a single addon name.

The main idea is to obtain the metadata from https://pypi.org/simple. The advantage of this approach is that it can be done in javascript in the browser, so the documentation page for an addon can be static, with a dynamic widget showing the metadata.

How to list the Odoo series for which the addon is available

In short:

  • if https://pypi.org/simple/odoo-addon-{addon-name}/ exists, look at the available wheel versions (will give series >= 15)
  • for older series, look for https://pypi.org/simple/odoo-addon{series}-{addon-name}/

Example : curl -sSL -H "Accept: application/vnd.pypi.simple.v1+json" https://pypi.org/simple/odoo-addon-mis-builder | jq

Details TBC.

How to get a METADATA file for an addon and Odoo series

In short: find the URL of the last available wheel and add a .metadata suffix. This will give a METADATA file as described below.

Details TBC.

Metadata details

Here we show the mapping from METADATA entries to __manifest__.py entries. Example.

  • Home-Page: website (GitHub repo URL)
  • Authors: author
  • Summary: summary
  • Requires-Dist: depends + external_dependencies["python"]
  • Version: version (plus one last digit, or plus .devN for older series)
  • License: license

__manifest__ metadata that is not available:

  • maintainers

The README is available in the METADATA files, so this may be exploitable in the browser? It is in .rst format, though.

TBC

@sbidoul sbidoul mentioned this issue Nov 16, 2024
21 tasks
@yajo
Copy link
Member

yajo commented Dec 11, 2024

This is a very nice approach!

Going a bit off-topic, I'm thinking that, instead of adding a download button like our current shop has (which I guess nobody uses), we can just have a section saying something like:

How to install:

pip install odoo-addon-mis-builder

That would fit well with a SSG like this, and still handle all dependencies automatically with close to zero maintenance on our side.

@sbidoul
Copy link
Member Author

sbidoul commented Dec 11, 2024

One worry I have with the frontend/js approach is SEO.

I wonder if we could use the GitHub API on merge in the addons repos, to trigger a workflow here that would do a partial rebuild and therefore have the metadata in the static pages.

@yajo
Copy link
Member

yajo commented Dec 11, 2024

Why do you think SEO would be affected?

@sbidoul
Copy link
Member Author

sbidoul commented Dec 11, 2024

Why do you think SEO would be affected?

The frontend folks I frequent tend to tell me dynamic content negatively affects SEO. That was certainly true in the past. I never bothered to look for a definitive modern explanation for this, though.

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

No branches or pull requests

2 participants