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

Modernize package #75

Merged
merged 15 commits into from
Oct 18, 2024
Merged

Modernize package #75

merged 15 commits into from
Oct 18, 2024

Conversation

ChristopherMayes
Copy link
Owner

@ChristopherMayes ChristopherMayes commented Oct 17, 2024

This modernizes the Python package infrastructure to the same level as LUME-Genesis:

  • Linting with pre-commit and ruff
  • pyproject.toml
  • conda setup
  • ruff linting

.flake8 Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't using flake8 really - ruff does all the linting and has its own settings in pyproject.toml - so I think this isn't necessary

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, removed

.github/workflows/gh-pages.yml Outdated Show resolved Hide resolved

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be sure to update your GitHub pages settings (and remember the v* tag whitelist)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, thanks

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

exclude: "^(python/versioneer.py|python/src/_version.py)$"

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run pre-commit autoupdate - these versions are behind

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're reformatting all of the code, you may as well sort imports now, too. That part isn't automatic in our configuration just yet.

ruff check --fix --extend-select=I pmd_beamphysics/
``

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ChristopherMayes ChristopherMayes merged commit 9287ad0 into master Oct 18, 2024
14 checks passed
@ChristopherMayes ChristopherMayes deleted the modernize_package branch October 26, 2024 17:05
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