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

[WiKi][FIX] Use temporary reference(s) to another pull request(s) - link structure #552

Closed
mymage opened this issue Dec 28, 2022 · 6 comments

Comments

@mymage
Copy link
Member

mymage commented Dec 28, 2022

On the referenced page there is template of the link to use:
odoo-addon-<module_name_with_dashes> @ git+https://github.com/OCA/<repository>/refs/pull/<PR_number>/head#subdirectory=setup/<module_name>
For newbie like me I suggest to change it to:
odoo-addon-<module_name_with_dashes> @ git+https://github.com/OCA/<repository>.git@refs/pull/<PR_number>/head#subdirectory=setup/<module_name_with_dashes>

@pedrobaeza

Thanks

@pedrobaeza
Copy link
Member

Hi, @mymage. If I look at the setup folder of any repository, I see the folder with underscores, not dashes:

https://github.com/OCA/l10n-spain/tree/15.0/setup

So I think it's correct right now.

@mymage
Copy link
Member Author

mymage commented Jan 3, 2023

Hola @pedrobaeza I apologize, you are right for module name, I copied/wrote it wrong.

But on PR OCA/management-system#498 still open I used the format
odoo-addon-<module_name_with_underscore> @ git+https://github.com/OCA/<repository>.git@refs/pull/<PR_number>/head#subdirectory=setup/<module_name_with_underscore> and it works.
I don't know if the initial odoo-addon-* part depends on the repo.

The <repository>/refs part on the wiki I think it is wrong at least for the / that has to be @, the .git is only to evidence the difference beween the "name" of the repository and the "object" (for us newbie).

Thanks

@chienandalu
Copy link
Member

Having similar issues with another PR (OCA/survey@986a1f6), another point to take into account is how the repository modules are packed. In my case, had to to prefix my requirement with odoo13-addon- (maybe @sbidoul can enlighten us on why this difference between repositories, that I guess it has to do with this https://github.com/acsone/setuptools-odoo#versioning although I don't fully understand it 😅 )

@sbidoul
Copy link
Member

sbidoul commented Jan 3, 2023

Hi @chienandalu. For Odoo < 15, PyPI package names are constructed as odoo{series}-addon-addon_name. For Odoo >= 15, it is odoo-addon-addon_name.

The reason we could do this change, is that the pip dependency resolver is now smart enough to pick-up the correct addon version based on the installed Odoo version, so we can now have the same package name across Odoo series, which is simpler and avoid to create a whole new set of PyPI projects for each new Odoo series.

@mymage

  • Underscores vs dashes in package names don't matter for python packaging, but in the subdirectory part, it is important to use underscores, since it is the directory name. So it's better to user underscores in addon names everywhere.
  • The .git suffix in the repository URL should not matter for GitHub.

@chienandalu
Copy link
Member

Thanks for the heads up @sbidoul ! All clear now 👍

@pedrobaeza
Copy link
Member

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

4 participants