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

Migrate to hatch #749

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Migrate to hatch #749

wants to merge 28 commits into from

Conversation

willingc
Copy link
Member

Closes #747

@MSeal
Copy link
Member

MSeal commented Nov 17, 2023

Can we get a draft version without the linting / quoting changes? Would be a lot easier to review / iterate if we can undo that part for now.

@willingc
Copy link
Member Author

Absolutely @MSeal. I would love to see the precommit bot to avoid autofixing things.

Right now this is a draft. I want to see if by going to more modern packaging if we can get rid of tox and simplify CI.

@willingc willingc added the wip Work In Progress label Nov 18, 2023
Comment on lines +23 to +30
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: ruff
args:
- --fix
- id: ruff-format

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: ruff
args:
- --fix
- id: ruff-format

already added with switch flake8 -> ruff #752

Comment on lines -42 to -47
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
name: Black code
args: ["-S"]
Copy link
Member

Choose a reason for hiding this comment

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

why drop Black?

Copy link
Member

Choose a reason for hiding this comment

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

Because this adds ruff-format instead.

@@ -80,7 +80,7 @@
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'UPDATE.md']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_style = 'sphinx'
Copy link
Member

Choose a reason for hiding this comment

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

lets fo these changes in separate PR so it is easier to follow what is the main change/focus of this PR

Comment on lines +149 to +151
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # pyupgrade
Copy link
Member

Choose a reason for hiding this comment

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

lets rather apply these one by one in separate PRs

"moto",
"notebook",
"pip>=18.1",
"pre-commit",
Copy link
Member

Choose a reason for hiding this comment

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

does it have also split to dev and base requirements?

@willingc
Copy link
Member Author

@Borda I'm going to close this PR but am leaving open right now as a WIP as I'm going to write a tutorial for the hatch maintainer about migrating an existing repo to hatch.

@Borda
Copy link
Member

Borda commented Nov 21, 2023

I'm going to write a tutorial for the hatch maintainer about migrating an existing repo to hatch.

looking forward to reading it it would be an interesting solution for a few of my projects...

@akx
Copy link
Member

akx commented Dec 19, 2023

@Borda FWIW, I've found that hatch new --init does a pretty good job in many cases; you can combine that with flake8-to-ruff, pyproject-migrator and pylint-to-ruff in a suitable combination... 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do an audit of requirements files, pyproject.toml, ci config, tox
4 participants