Skip to content

remove cache options #158

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

Merged
merged 5 commits into from
Jul 20, 2022
Merged

remove cache options #158

merged 5 commits into from
Jul 20, 2022

Conversation

twoertwein
Copy link
Member

mypy is already called with --no-incremental which disables the cache. I simply added the corresponding flag for pytest, to remove this flag.

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 20, 2022

mypy is already called with --no-incremental which disables the cache. I simply added the corresponding flag for pytest, to remove this flag.

I don't think it is called with --no-incremental when you run locally. So I think this option should be kept.

@twoertwein
Copy link
Member Author

mypy --help says:

--no-incremental Disable module cache (inverse: --incremental)

So I assume that is effectively the same as deleting the cache (but it it less code on our side to achieve it)

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 20, 2022

mypy --help says:

--no-incremental Disable module cache (inverse: --incremental)

So I assume that is effectively the same as deleting the cache (but it it less code on our side to achieve it)

Yes, but I don't see that we are running with --no-incremental by default??

@twoertwein
Copy link
Member Author

That seems to be the case on main:

cmd = ["mypy", "pandas-stubs", "tests", "--no-incremental"]

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 20, 2022

That seems to be the case on main:

cmd = ["mypy", "pandas-stubs", "tests", "--no-incremental"]

Ah, good. So you're right that we don't need the option!

pyproject.toml Outdated
@@ -166,7 +145,7 @@ enable_error_code = "ignore-without-code" # same as in pandas
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = false # pyright behaves the same
implicit_reexport = true
Copy link
Member Author

Choose a reason for hiding this comment

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

Could re-enable this option again as mypy 0.971 seems to need npt = numpy.typing in either case

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Given that you had to change the npt reference because of mypy 0.971, can you bump the version in pyproject.toml ?

@@ -14,7 +13,7 @@ def pyright_src():


def pytest():
cmd = ["pytest"]
cmd = ["pytest", "--cache-clear"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

double checking that not clearing the cache will always work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Locally, I do not need to clear the cache. Happy to remove it. The CI will anyways have a clean plate every time it runs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I see. Now your proposal is to always clear the cache. I think that's a good idea. Equivalent to what will happen with mypy where we always use --no-incremental

Copy link
Member Author

Choose a reason for hiding this comment

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

I would be fine with keeping the pytest cache - just wanted to match the behavior of mypy.


def clean_pytest_cache():
if Path(".mypy_cache").exists():
shutil.rmtree(".pytest_cache")
Copy link
Collaborator

Choose a reason for hiding this comment

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

the test was wrong here, so the -c never worked!

Copy link
Member Author

Choose a reason for hiding this comment

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

hahaha :) I didn't notice that when I removed it :)

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Thanks @twoertwein

@Dr-Irv Dr-Irv merged commit 5f47ff7 into pandas-dev:main Jul 20, 2022
@twoertwein twoertwein deleted the cache branch September 21, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants