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

SUPP: Pin back version of isort #2079

Merged
merged 5 commits into from
Feb 20, 2020

Conversation

xmnlab
Copy link
Contributor

@xmnlab xmnlab commented Feb 12, 2020

isort 4.3.21 formatting conflicts in some cases with black. I am moving back isort to the previous pinning.
also isort from master has a lot of formatting conflicts with black

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 12, 2020

I opened a follow up issue for this: #2080

@xmnlab xmnlab changed the title Pin back version of isort SUPP: Pin back version of isort Feb 12, 2020
@xmnlab xmnlab requested review from icexelloss and jreback February 12, 2020 19:00
@anmyachev
Copy link
Contributor

@xmnlab can you give an example demonstrating the problem? Why not take the release version of isort and install only using conda (not in pip section) ?

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 13, 2020

@anmyachev you can run locally pre-commit run --all-files and you can see the conflicts. IIRC it has conflicts with 3 files.

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 13, 2020

let me know if you could reproduce the error locally.

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 13, 2020

IIRC the conflict is with adding new lines before comments in the import section (ensure_newline_before_comments)

.isort.cfg Outdated
@@ -1,3 +1,7 @@
[settings]
known_third_party = asv,click,clickhouse_driver,dateutil,google,graphviz,impala,jinja2,kudu,multipledispatch,numpy,pandas,pkg_resources,plumbum,psycopg2,pyarrow,pydata_google_auth,pygit2,pymapd,pymysql,pyspark,pytest,pytz,regex,requests,ruamel,setuptools,sphinx_rtd_theme,sqlalchemy,toolz
ensure_newline_before_comments=true
line_length = 79
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, I think these should all be in setup.cfg which is the common place, why are we moving here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved that because isort was already using that .. so just to keep all configurations in just one file

but I check and setup.cfg also is supported: https://github.com/asottile/seed-isort-config/blob/master/seed_isort_config.py#L19

I will try to move all this to setup.cfg

@@ -53,5 +52,6 @@ dependencies:
- xorg-libxpm
- xorg-libxrender
- pip:
# see .pre-commit-config.yaml, we pin to specific versions of black and isort
# see .pre-commit-config.yaml, isort pinned
Copy link
Contributor

Choose a reason for hiding this comment

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

really we need to pin like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now I think we need it because the conflicts.
maybe also we can replace the black checking inside CI for a pre-commit check

@jreback jreback added the ci Continuous Integration issues or PRs label Feb 13, 2020
@anmyachev
Copy link
Contributor

let me know if you could reproduce the error locally.

I could reproduce this.
Can we add something like this "we should try using isort release that will be next after 4.3.21-2"?

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 18, 2020

@jreback @anmyachev it is ready for a new review! thanks!

@xmnlab xmnlab requested a review from jreback February 18, 2020 17:29
@@ -56,6 +56,10 @@ black:
# check that black formatting would not be applied
black --check .

check_pre_commit_hooks:
Copy link
Contributor

Choose a reason for hiding this comment

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

please also add next target:

docker_check_pre_commit_hooks: build
    # check if all pre-commit hooks are passing inside ibis container
    $(DOCKER_RUN) pre-commit run --all-files

So we will be able to use one target in CI and locally.

@@ -62,8 +62,8 @@ jobs:
- bash: docker-compose run ibis pydocstyle --match-dir="(ibis|omniscidb)"
displayName: "Docstring check"

- bash: make docker_black PYTHON_VERSION=$PYTHON_VERSION
displayName: 'Ensure black formatting'
- bash: docker-compose run ibis make check_pre_commit_hooks
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use next command: make docker_check_pre_commit_hooks PYTHON_VERSION=$PYTHON_VERSION

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 18, 2020

Thanks @anmyachev for the review. I added your suggestions.

@xmnlab xmnlab force-pushed the fix-git-precommit-hooks branch from 56df7a2 to 498b8db Compare February 18, 2020 19:03
@xmnlab xmnlab force-pushed the fix-git-precommit-hooks branch from 498b8db to f643f60 Compare February 18, 2020 19:05
@anmyachev
Copy link
Contributor

@xmnlab maybe the link can help to fix makefile issue: https://stackoverflow.com/questions/16931770/makefile4-missing-separator-stop

@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 18, 2020

thanks @anmyachev for the link!

@xmnlab xmnlab force-pushed the fix-git-precommit-hooks branch from 1209123 to f3add9d Compare February 18, 2020 19:40
@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 18, 2020

ready for review :)

@anmyachev
Copy link
Contributor

LGTM, @jreback ?

@jreback jreback added this to the Next Feature Release milestone Feb 20, 2020
@jreback jreback merged commit 7d7fbdf into ibis-project:master Feb 20, 2020
@jreback
Copy link
Contributor

jreback commented Feb 20, 2020

thanks @xmnlab

@xmnlab xmnlab deleted the fix-git-precommit-hooks branch February 20, 2020 18:38
@xmnlab
Copy link
Contributor Author

xmnlab commented Feb 20, 2020

thanks @anmyachev and @jreback for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration issues or PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants