Open oyale opened 1 year ago
Thanks for the suggestion. I would love to publish them to pypi, but I haven't had the incentive to figure out how to do it. I will look at the documents you've pointed to and I'll let you know how it goes (or if I need help).
Thanks.
On 05/01/2023 19:00, Pelayo García wrote:
Hi!
I just wanted to ask you if you would consider publishing the modules from this repository on pypi.org. I've looked for it, but haven't found anything. As I'm sure you know, PyPI is a central repository for Python packages, and it's the standard way we - at @coopdevs https://github.com/coopdevs/ - install modules for Odoo deployments. (Specifically, we use this Ansible role https://github.com/coopdevs/odoo-role)
We have found some modules in this repository to be really nice, and we thought it would be even easier for others to use and benefit from them if they were published in PyPI. In addition, it would increase the visibility of your project within the Python community.
If you need help with the publishing process, don't hesitate to let us know. We will be happy to assist you in any way we can. Just in case, here are our internal docs on how to publish Odoo modules in PyPI https://handbook.coopdevs.org/ca/Odoo/Sysadmin/Packaging-Odoo-Addons.
Thank you very much for all the work and effort you have shared here. They are very much appreciated.
Best regards, Pelayo.
— Reply to this email directly, view it on GitHub https://github.com/trevi-software/trevi-misc/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4YOHEWA2AF3TNHYINFGMDWQ3V27ANCNFSM6AAAAAATSDOZ4U. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Probably, the most tedious part is to create the account on pypi.org (and test.pypi.org/). Otherwise, I'd say it's pretty much straightforward.
I leave below the specific instructions.
You can create and activate a venv:
python -m venv venv
source venv/bin/activate
And install the tools
pip install twine wheel setuptools-odoo
Assuming no previous work on pypi has been done, we need to check for the file structure. Odoo community has its own standards. It can be a single repo module, or more frequently, a multi-module repo. In any case, we will need a certain folder structure and a __manifest__.py
for each addon.
version
must have 5 levels: 2 for Odoo (e.g. 12.0) and 3 for addon (e.g. 1.5.2)website
must be a URL, therefore, must include the protocol part, i.e. https://
installable
is a flag to disable the addon from being installed to Odoo or being packed for pypi.Place yourself at the root of the repo:
ls .
addon1/
addon2/
And then run
setuptools-odoo-make-default -d .
A new setup/
folder with this structure:
...
setup/addon1/odoo/addons/<addon1_name> -> ../../../../<addon1_name>
setup/addon2/setup.py
...
This must be only once if no addons are added. Removed addons should remove too their setup/ symlinks.
Since setuptools-odoo
relies on what's committed to your Git repository, you need to commit the changes occurred in the setup/
directory before executing the next steps.
If you don't do that, setuptools
will create an empty build/
directory and your package will be broken and not recognized by Odoo. More details here.
This is the first half of cyclical packaging process. For each addon, do:
cd setup/addon_name
python setup.py bdist_wheel --universal sdist
cd ../..
You can inspect the generated dir setup/addon_name/odooXX_addon_addon_name.egg-info/
:
PKG-INFO
: version, name, author, etc. Mostly compiled from Odoo manifest file. See how and why weird version numbers like ···99.dev17
are computedSOURCES.txt
: included files. Useful if you added a new translation or class and want to ensure it's there. Bear in requires.txt
: pip dependencies.This whole process is git-dependand. Both versions and sources depend on git: version to decide the devXX number, and sources to ignore untracked files.
For any doubt of what's inside, you can unzip the whl
file in dist/
to see what's in.
If you are testing, you can use the test pypi instance just by inserting --repository-url https://test.pypi.org/legacy/
to the next command, just after upload
:
Otherwise, just do for each addon to upload:
cd setup/addon_name
twine upload dist/*
# fill in credentials
# wait for the upload
cd ../..
Hi!
I just wanted to ask you if you would consider publishing the modules from this repository on pypi.org. I've looked for it, but haven't found anything. As I'm sure you know, PyPI is a central repository for Python packages, and it's the standard way we - at @coopdevs - install modules for Odoo deployments. (Specifically, we use this Ansible role)
We have found some modules in this repository to be really nice, and we thought it would be even easier for others to use and benefit from them if they were published in PyPI. In addition, it would increase the visibility of your project within the Python community.
If you need help with the publishing process, don't hesitate to let us know. We will be happy to assist you in any way we can. Just in case, here are our internal docs on how to publish Odoo modules in PyPI.
Thank you very much for all the work and effort you have shared here. They are very much appreciated.
Best regards, Pelayo.