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

Use a "-" as a delimeter for filenames of temporary files #1296

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

lrlunin
Copy link
Contributor

@lrlunin lrlunin commented Dec 15, 2024

Based on the issue #1289 I propose a solution using the "-" (minus) instead of "_" (underscore) for the delimiter of original filename and filename of temporary file.

I suggest to take "-" since the "safe" characters to use in filename for all platforms are [0-9a-zA-Z-._] while the "_" already interferes with poor chosen python temp filename naming sequence characters. I would also do not take "." since it is already used for the file extension on the right and is more error prone if the file has no extension prefix.

This let us basically only with the "-" as a valid character.

Thanks!

Copy link

Thank you for making this pull request.

Did you know? You can try it on Binder: Binder:lab or Binder:notebook.

Also, the version of Jupytext developed in this PR can be installed with pip:

HATCH_BUILD_HOOKS_ENABLE=true pip install git+https://github.com/lrlunin/jupytext.git@main

(this requires nodejs, see more at Developing Jupytext)

@mwouts
Copy link
Owner

mwouts commented Dec 15, 2024

That's fine by me. Thanks for looking into this! Before I merge I will make sure the tests pass (not sure why they were not triggered 🤔 )

@lrlunin
Copy link
Contributor Author

lrlunin commented Dec 15, 2024

not sure why they were not triggered 🤔

I guess because I am making the 1st pull-request in this repo you need to permit to CI actions to execute. For me it says:

This workflow is awaiting approval from a maintainer in #1296

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.02%. Comparing base (d0e5b7a) to head (592ef82).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1296   +/-   ##
=======================================
  Coverage   97.02%   97.02%           
=======================================
  Files          29       29           
  Lines        4501     4501           
=======================================
  Hits         4367     4367           
  Misses        134      134           
Flag Coverage Δ
external 74.94% <100.00%> (-0.10%) ⬇️
functional 88.35% <100.00%> (ø)
integration 77.27% <0.00%> (ø)
unit 66.45% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lrlunin
Copy link
Contributor Author

lrlunin commented Dec 16, 2024

I am now wondering if it still makes sense to choose either from " " and "-" depending if spaces are in original filenames. Maybe then always use "-" as delimeter. Otherwise the steps to obtain the original filename would be different if there were spaces in it or not.

Copy link
Owner

@mwouts mwouts left a comment

Choose a reason for hiding this comment

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

Thanks, yes I do prefer that version too!

@lrlunin
Copy link
Contributor Author

lrlunin commented Dec 16, 2024

Since this is still my first pull-request you need to approve this workflow again :-)

@mwouts
Copy link
Owner

mwouts commented Dec 16, 2024

Oh I understood what's happening here! I don't get to see the button when I use the "new merge experience"...

@lrlunin
Copy link
Contributor Author

lrlunin commented Dec 16, 2024

I believe that this PR is not responsible for the code test coverage drop below 97% 😨

@mwouts mwouts merged commit 1f5c68a into mwouts:main Dec 16, 2024
32 checks passed
@mwouts
Copy link
Owner

mwouts commented Dec 16, 2024

I believe that this PR is not responsible for the code test coverage drop below 97% 😨

np, I will look into that later on. Thanks for your PR!

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