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

update poetry install #5

Merged
merged 5 commits into from
Feb 24, 2024
Merged

update poetry install #5

merged 5 commits into from
Feb 24, 2024

Conversation

byersiiasa
Copy link
Member

@byersiiasa byersiiasa commented Feb 15, 2024

Install is mostly working, but now getting stuck on sphinx-build. I couldn't work it out looking at ixmp4 though, would sphinx need to be in the pyproject.toml?

@glatterf42

@byersiiasa
Copy link
Member Author

byersiiasa commented Feb 15, 2024

@glatterf42 i don't understand the lint fails also - am I supposed to run black everytime before push or should it happen automatically?

@glatterf42
Copy link
Member

For sphinx, we do have this in ixmp4:

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
sphinx = "^7.2.6"
sphinx-multiversion = "^0.2.4"
sphinx-rtd-theme = "^2.0.0"
sphinxcontrib-bibtex = "^2.6.2"
sphinxcontrib-openapi = "^0.8.3"

This is making use of poetry's optional dependency groups. You can specify these and they will only be installed if explicitly requested on the command line. So for the full install command, you'd then need to run poetry install --with docs. This allows users who are only interested in core functionality to keep the installation size small.

@glatterf42
Copy link
Member

About the code style: I'm not sure whether you want to keep using black or switch to ruff. We are currently using ruff for most parts of our message stack since it combines formatting (which is compatible with black) with linting capabilities.

In general, if you want your code to adhere to a certain style, these are your options: run the formatting tools manually before you push or have them run automatically, yes. Formatting manually is error-prone, that's why we recently organized a workshop about setting up tools to run automatically (e.g. every time you hit save in your editor or before every git commit is accepted). You might be interested in finding the slides about that here (the audio recording of the presentation is quite bad, unfortunately).

At the very least, if you want to stick with black and keep the existing GitHub Action as similar as possible, I'd recommend the following updates:

# This workflow checks that the code conforms to the Black style
# See https://black.readthedocs.io/en/stable/github_actions.html for details

name: Black formatting

on: [pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
      - uses: psf/black@stable
        with:
          options: "--color"

@byersiiasa byersiiasa removed the request for review from glatterf42 February 24, 2024 20:12
@byersiiasa byersiiasa marked this pull request as ready for review February 24, 2024 20:12
@byersiiasa byersiiasa merged commit 64f1255 into main Feb 24, 2024
1 of 2 checks passed
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