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

MISC: Check that min versions are aligned in CI and import_optional_dependency #45219

Merged
merged 21 commits into from
Jan 17, 2022

Conversation

mroeschke
Copy link
Member

Follow up to include install.rst

@attack68
Copy link
Contributor

attack68 commented Jan 6, 2022

when you update pre-commit hooks, does one have to update dev environment with some git command, or is the addition of new files and new code enough for the hooks to operate as expected?

.pre-commit-config.yaml Show resolved Hide resolved
@mroeschke
Copy link
Member Author

when you update pre-commit hooks, does one have to update dev environment with some git command, or is the addition of new files and new code enough for the hooks to operate as expected?

Nope. pre-commit will run (and install new dependencies if needed) with the changes of .pre-commit-config.yaml and addition of scripts. IIRC pre-commit runs in it's own virtual environment.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Jan 7, 2022
@mroeschke mroeschke modified the milestones: 1.4, 1.5 Jan 7, 2022
Copy link
Member

@lithomas1 lithomas1 left a comment

Choose a reason for hiding this comment

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

LGTM. Someone more familiar with the pre-commit hooks might want to review this though.
cc @MarcoGorelli.

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

generally looks good, just left a comment on files

.pre-commit-config.yaml Show resolved Hide resolved
@MarcoGorelli MarcoGorelli self-requested a review January 12, 2022 19:16
scripts/validate_min_versions_in_sync.py Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
scripts/validate_min_versions_in_sync.py Outdated Show resolved Hide resolved
@@ -59,6 +66,9 @@ def get_version(module: types.ModuleType) -> str:

if version is None:
raise ImportError(f"Can't determine version for {module.__name__}")
if module.__name__ == "psycopg2":
Copy link
Contributor

Choose a reason for hiding this comment

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

can you integrate this to L64, e.g. maybe make a separate make of module -> lambda functions that can handle the special case modules?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm the L64 block handles if __version__ is not the correct path to the version. psycopg2 uses __version__ so it wouldn't hit this path

import version

sys.modules["pandas.util.version"] = version
import _optional
Copy link
Contributor

Choose a reason for hiding this comment

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

can you import these as fully qualified and/or make this whole section a bit more idiomatic (i know tricky, but give a try)

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried playing around with this but couldn't simplify it further than what @lithomas1 suggested.

@jreback
Copy link
Contributor

jreback commented Jan 16, 2022

also pls rebase

@MarcoGorelli MarcoGorelli self-requested a review January 17, 2022 09:48
@jreback
Copy link
Contributor

jreback commented Jan 17, 2022

@mroeschke can you rebase this to make sure ok (as merged @lithomas1 change)

@jreback jreback merged commit 388ecf3 into pandas-dev:main Jan 17, 2022
@mroeschke mroeschke deleted the validate/min_verions branch January 17, 2022 20:36
@simonjayhawkins
Copy link
Member

simonjayhawkins commented Jan 21, 2022

it's not urgent (i.e. block 1.4) but would be good to keep the ci files in sync on 1.4.x and main until they need to diverge for say Python 3.11 so that ci backports have less chance of needing manual intervention.

could either sync ci/deps/actions-38-minimum_versions.yaml or backport this PR.

@mroeschke
Copy link
Member Author

Might be better to backport this PR since it has some additional changes to pandas/compat/_optional.py, but no strong opinion on my side.

@simonjayhawkins simonjayhawkins modified the milestones: 1.5, 1.4 Jan 21, 2022
@simonjayhawkins
Copy link
Member

@meeseeksdev backport 1.4.x

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jan 21, 2022
jreback pushed a commit that referenced this pull request Jan 21, 2022
…nd import_optional_dependency (#45537)

Co-authored-by: Matthew Roeschke <emailformattr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants