Open astrojuanlu opened 1 year ago
Thanks. Can you also provide $PATH? That's usually the source of discrepancies like this.
I don't understand how the $PATH
might affect here but there you go:
"Bad" machine:
(kedro_builder) circleci@ba9ad917c955:~/project$ which pylint
/home/circleci/miniconda/envs/kedro_builder/bin/pylint
(kedro_builder) circleci@ba9ad917c955:~/project$ pylint --version
pylint 2.17.4
astroid 2.15.6
Python 3.8.16 (default, Jun 12 2023, 18:09:05)
[GCC 11.2.0]
(kedro_builder) circleci@ba9ad917c955:~/project$ echo $PATH
/home/circleci/miniconda/envs/kedro_builder/bin:/home/circleci/miniconda/condabin:/home/circleci/.local/bin:/home/circleci/bin:/home/circleci/.pyenv/shims:/home/circleci/.pyenv/bin:/home/circleci/.poetry/bin:/home/circleci/bin:/home/circleci/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
"Good" machine:
gitpod /workspace/kedro (dev/fix-requirements-take-2) $ which pylint
/home/gitpod/.pyenv/shims/pylint
gitpod /workspace/kedro (dev/fix-requirements-take-2) $ pylint --version
pylint 2.17.4
astroid 2.15.6
Python 3.8.15 (default, Jun 28 2023, 13:31:36)
[GCC 11.3.0]
gitpod /workspace/kedro (dev/fix-requirements-take-2) $ echo $PATH
/home/gitpod/.sdkman/candidates/maven/current/bin:/home/gitpod/.sdkman/candidates/java/current/bin:/home/gitpod/.sdkman/candidates/gradle/current/bin:/workspace/.cargo/bin:/home/gitpod/.rvm/gems/ruby-3.2.1/bin:/home/gitpod/.rvm/gems/ruby-3.2.1@global/bin:/home/gitpod/.rvm/rubies/ruby-3.2.1/bin:/home/gitpod/.pyenv/shims:/workspace/go/bin:/home/gitpod/.nix-profile/bin:/ide/bin/remote-cli:/home/gitpod/go/bin:/home/gitpod/go-packages/bin:/home/gitpod/.nvm/versions/node/v18.16.0/bin:/home/gitpod/.yarn/bin:/home/gitpod/.pnpm:/home/gitpod/.pyenv/bin:/home/gitpod/.rvm/bin:/home/gitpod/.cargo/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin/:/home/gitpod/.local/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/gitpod/.nvm/versions/node/v18.16.0/bin
Bad machine = CircleCI job https://app.circleci.com/pipelines/github/kedro-org/kedro/24429/workflows/0abf7a3a-ee7a-43a1-a8e8-4211e0e58447/jobs/282191
Good machine = Any other machine, tested on both my local macOS and a Gitpod instance https://github.com/kedro-org/kedro/tree/dev/fix-requirements-take-2
I don't understand how the $PATH might affect here
wrong-import-order
depends on the determination isort
makes about whether a package is first-party or third-party. The value of $PATH
can affect that determination depending on how things are packaged and also the current working directory. Whether that violates the principle of least surprise is a whole other thing, but it's the status quo at the moment.
Thanks for the additional details.
wrong-import-order depends on the determination isort makes about whether a package is first-party or third-party.
So, pylint uses isort under the hood?
That's interesting, because we're running pylint
as part of a larger linting action using pre-commit, and in both cases isort
runs ahead of pylint
and deems the files correct.
Pylint might be doing additional patching of sys.path, see #5226.
Will keep this open for investigation. A fast workaround would be to add 'build' to known third party packages (on mobile, don't have the exact wording of the config option name).
Bug description
In one system
pylint
is perfectly fine, but in another it's complaining about import order.Configuration
Configuration is identical in both systems:
Command used
Pylint output
Expected behavior
Pylint version
OS / Environment
Ubuntu 22.04 in both cases
Additional dependencies
"Bad" machine:
"Good" machine: