-
Notifications
You must be signed in to change notification settings - Fork 90
Inconsistencies fix #564
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
Inconsistencies fix #564
Conversation
Hello @Dark-Rock, PS: This message was sent automatically! |
First, if this PR is accepted or not is up to @alallema and not me. With that I wouldn't work on anything I mention here until she decides if she want to accept it or not. Black should be added as a dev dependency and also a CI check, otherwise things will get out of sync again. My suggestion for the [tool.black]
line-length = 100
include = '\.pyi?$'
exclude = '''
/(
\.egg
| \.git
| \.hg
| \.mypy_cache
| \.nox
| \.tox
| \.venv
| \venv
| _build
| buck-out
| build
| dist
| setup.py
)/
''' The default line length for black is 88 so the 100 is just my personal preference, @alallema if you decide to accept this at all line length is totally your call and can be anything you want. The other settings are default black settings (and black purposefully has almost no settings options). Then in black:
name: black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install pipenv
uses: dschep/install-pipenv-action@v1
- name: Install dependencies
run: pipenv install --dev
- name: black
run: pipenv run black meilisearch tests setup.py --check Either as part of this PR or as a separate PR I would also add isort. For this, add isort as a dev dependency with the following in [tool.isort]
profile = "black"
line_length = 100
src_paths = ["meilisearch", "tests", "setup.py"] And the following CI check isort:
name: isort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install pipenv
uses: dschep/install-pipenv-action@v1
- name: Install dependencies
run: pipenv install --dev
- name: isort
run: pipenv run isort meilisearch tests setup.py --check-only mypy and pylint setting could also be moved to the pyproject.toml, but that is an easy follow-up PR. @alallema for some context, this will make your life easier in PR reviews. It means you only have to review for functionality, formatting is guaranteed through a CI check meaning you don't have to worry about that part in your review. It is basically the python equivalent to running |
Hi @Dark-Rock, Thank @sanders41 for all information you provide 🚀
I think so too, I see that a PR has been created for this purpose 🎉 thanks again @Dark-Rock for this and it seems to be following all the advice you give I will review it soon.
I don't really have an opinion on question 88 seems to me like 100, maybe the shorter one would be easier to read.
Oh, I like to have import sort 😍
Yes, perfect I would add an issue about it at the end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Dark-Rock for this PR!
Everything looks good to me but as @sanders41 suggested it:
Black should be added as a dev dependency and also a CI check,
It should be really nice to add black
as a dev dependency and also add an example of a command line in the CONTRIBUTING
to explain how to run it.
You can take examples on other contributing guides if you need for example dotnet or go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Dark-Rock,
Thanks for your changes, I'm sorry I should tell you that you have to add it in setup.py
but also to Pipfile
and commit the changes of Pipfile.lock
too.
You should be able to add it with the command:
pipenv install --dev <package-name>
Good job for the README ✨
Co-authored-by: Paul Sanders <[email protected]>
Co-authored-by: Paul Sanders <[email protected]>
Co-authored-by: Paul Sanders <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Dark-Rock, Pipfile.lock
is still missing, also I'm sorry I will merge a new PR with modifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dark-Rock perfect the dependencies are in a good place! I just add few comments 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @Dark-Rock for this particularly tedious PR ❤️
LGTM! 🔥 🔥 🔥
bors merge |
Build succeeded:
|
This message is sent automatically Thanks again for contributing to Meilisearch ❤️ |
566: Pyprojecttoml migration r=alallema a=Dark-Rock # Pull Request ## Related issue Fixes #565 Also based on this [comment](#564 (comment)) ## What does this PR do? - Migrate the setups in the pyproject.toml file - Enable black integration and black test in order to maintain consistency in the code base. - Enable isort integration and isort test in order to maintain consistency in the code base. ## PR checklist Please check if your PR fulfills the following requirements: - [X] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [X] Have you read the contributing guidelines? - [X] Have you made sure that the title is accurate and descriptive of the changes? Co-authored-by: JeremyNgu108 <[email protected]> Co-authored-by: Dark-Rock <[email protected]> Co-authored-by: Paul Sanders <[email protected]> Co-authored-by: Amélie <[email protected]>
Pull Request
Related issue
Fixes #563
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!