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

[Python] Format generated files using ruff #3578

Merged
merged 8 commits into from
Nov 1, 2023
Merged

Conversation

dbrattli
Copy link
Collaborator

@dbrattli dbrattli commented Oct 31, 2023

Use Ruff formatter on the generated Python output files. This makes the generated files easier to read and also makes it easier to spot any issues with the generated code. Ruff format is Black compatible but super fast so it doesn't really add much to the total compile time.

@dbrattli
Copy link
Collaborator Author

@MangelMaxime Any ideas about this? I'm not familiar with the new build system, so perhaps there's something obvious I'm doing wrong? Works locally btw on my mac. https://github.com/fable-compiler/Fable/actions/runs/6703457876/job/18214036253?pr=3578#step:6:52

- Install Python tools from the repository root
- Invoke ruff from the repository root
@MangelMaxime
Copy link
Member

@dbrattli It seems like the CI is fixed now.

For me the problem seems to be that you were trying to run poetry before it was installed on the CI.

And you also tried to invoke it from inside the temp/fable-libary-py/library_py folder when the tool is installed at the root of the repository.

One question that I have is do we still need to have fable-library reference in the top level pyproject?

Fable/pyproject.toml

Lines 15 to 16 in 5d309a0

[tool.poetry.dev-dependencies]
fable-library = {path = "./temp/fable-library-py", develop = true}

Because of that line, I had to not restore the poetry dependencies directly in the CI commands but only after fable-library-py has been built otherwise the path is missing.

@dbrattli
Copy link
Collaborator Author

@MangelMaxime Aha, I see, thanks a lot for fixing!!

@MangelMaxime
Copy link
Member

No problem, happy to help on what I can. :)

@dbrattli dbrattli merged commit 9f309c7 into main Nov 1, 2023
14 checks passed
@dbrattli dbrattli deleted the python-ruff-formatting branch November 1, 2023 07:43
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