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

[16.0][IMP] resource_booking: pyproject.toml #144

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

norlinhenrik
Copy link

No description provided.

@pedrobaeza
Copy link
Member

This is not correct. The file goes inside a module folder, not on the root, and it's populated automatically by pre-commit when needed.

@pedrobaeza pedrobaeza added this to the 16.0 milestone Jan 20, 2025
@norlinhenrik
Copy link
Author

But there is no such automation in 16.0, and I don't know how to set it up.
Can you please help me with this, or accept the PR?

@norlinhenrik
Copy link
Author

Sorry, I meant to put it inside resource_booking.

@pedrobaeza
Copy link
Member

I don't get the goal of this, because it's perfectly fine working with the previous approach. Anyway, I don't use pip for Odoo and I don't like it.

@norlinhenrik
Copy link
Author

Have you tried uv as presented on the OCA days (see repo, slides and talk)? I think it is really cool. :)

[tool.uv.sources]
odoo-addon-resource-booking = { git = "https://github.com/OCA/calendar", subdirectory = "resource_booking" }

× Failed to download and build odoo-addon-resource-booking @ │ git+https://github.com/OCA/calendar#subdirectory=resource_booking
╰─▶ /home/henrik/.cache/uv/git-v0/checkouts/68862a3fc51fb503/9ddfab2/resource_booking does not appear to be
a Python project, as neither pyproject.toml nor setup.py are present in the directory

[tool.uv.sources]
odoo-addon-resource-booking = { git = "https://github.com/OCA/calendar", rev = "refs/pull/144/head", subdirectory = "resource_booking" }

Problem solved

@pedrobaeza
Copy link
Member

Yeah, the umpteenth Python package manager...

The question is that Odoo modules are not Python packages, and trying to make them to "appear" as if they are, only adds layers and layers and hacks, like the previous setup folderor this.tomlfile. Some think that is not too much, but for me is still twisting everything. And for not talking about Odooaddons_path` manipulation...

@norlinhenrik
Copy link
Author

norlinhenrik commented Jan 20, 2025

Try to install uv (e.g. sudo snap install astral-uv) and then:

git clone https://github.com/sbidoul/ocadays2024-odoo-project-demo -b uv-level4
cd ocadays2024-odoo-project-demo
uv run odoo

This is the easiest way I have ever seen to run a custom odoo project.

  • Everything is configured in pyproject.toml.
  • All dependencies become available in Odoo addons_path.
  • We can specify the source of a specific module.
  • uv.lock has the commit of each python source, including Odoo.

@pedrobaeza
Copy link
Member

A Doodba copier template is easiest in my opinion and covering more cases (devel, prod and demo instances, Mailhog, debuggers...)

@norlinhenrik
Copy link
Author

Doodba is good also, although it takes more steps to get started. The documentation is fairly good about setup and development. But I was not able to move on to test and production. Besides improving that part of the documentation, I suggest you make a doodba demo on the next OCA days, with slides and a repo showing step by step what to do. I just found now that you had a talk in 2020. I should have seen that before. Anyway, repetition is good.

Do you consider Doodba to be incompatible with installing Odoo as python modules?

@pedrobaeza
Copy link
Member

pedrobaeza commented Jan 20, 2025

Yes, it's incompatible by some reasons.

@norlinhenrik
Copy link
Author

I see.

I didn't plan to reply, but I am curious why Odoo python modules make a problem in Doodba?

BTW: Thank you for all your open source contributions! ❤️ Doodba has many cool features integrated, and I would like to learn them eventually.

@pedrobaeza
Copy link
Member

The reasons are technical, and they can be in any moment bypassed/fixed. Don't think it's another kind of resistance. It's just that I don't remember right now which ones.

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.

2 participants