-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: scripts/validate_docstrings.py should clean up files created from docstrings #24209
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
Comments
I think the same happen when running doctests. In theory we added That's probably not the best solution, as the comment is visible, and in some cases we open the files after generating them, and we need to skip larger parts of code. Not quite sure what would be the best approach in the long term. |
If you only want to prevent accidentally committing, how about adding tmp.xlsx in I think it is dangerous to forcibly delete file. |
Maybe we could create them in a tmp directory like |
It seems like them in a particular folder that's included in .gitignore is both flexible and backwards compatible. There are plenty of generated files that are already managed that way. What are the downsides? |
Saving to Using the module May be the best solution is to change the current directory in sphinx, so we can use something like |
What if we don't use files and opt for StringIO / BytesIO objects instead? With Python2 getting dropped soon we should just be able to make calls to
|
So the issue, although related to committing inappropriate files, isn't that explicitly. It sounds like you either want to control which files are created, or which files are automatically deleted before committing even becomes an issue. |
In my opinion, in an example wants to show to a beginner user how to save a csv file, showing From our side of keeping things clean in the pandas repo directories, I agree |
I think that's a fair point @datapythonista. The primary concern is avoiding committing/shipping unnecessary files (i.e. |
Discovered in #24194
Running
$ python scripts/validate_docstrings.py pandas.read_excel
Produces a file
tmp.xlsx
in the pandas directory from a docstring in read_excel. We don't want to be accidentally committing these files; therefore,validate_docstrings.py
should be removing any temporary artifacts after runs.cc @datapythonista
The text was updated successfully, but these errors were encountered: