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 underscores instead of spaces in paths #332

Merged
merged 8 commits into from
Jul 25, 2024
Merged

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Mar 28, 2023

For python/core-workflow#186.

Companion to python/core-workflow#499.

I've not tested this other than running the unit tests.

I think this is all we need for blurb-it? For example, there's already "Tools-Demos" with no "/".

Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

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

If I'm reading the code correctly, this value is retrieved here:

section = data.get("section", "").strip()
news_entry = data.get("news_entry", "").strip() + "\n"
path = await util.get_misc_news_filename(issue_number, section, news_entry)

and then used to create the filename in:

async def get_misc_news_filename(issue_number, section, body):
date = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
nonce = await nonceify(body)
path = f"Misc/NEWS.d/next/{section}/{date}.gh-issue-{issue_number}.{nonce}.rst"
return path

There is only a test for this function:

async def test_get_misc_news_filename():
path = await util.get_misc_news_filename(
issue_number=123,
section="Library",
body="Lorem ipsum dolor amet flannel squid normcore tbh raclette enim"

The changes look OK to me, even though they don't seem to be covered by the tests. If you think it's worth it, you could add another test for get_misc_news_filename, and possibly update its code to reject sections that include spaces.

@hugovk
Copy link
Member Author

hugovk commented Apr 3, 2023

Sure, updated!

@hugovk
Copy link
Member Author

hugovk commented Jul 26, 2023

Updated to use underscores instead of hyphens, to match blurb, as decided during the EuroPython sprint: python/core-workflow#499 (comment)

@AlexWaygood AlexWaygood changed the title Use dashes instead of spaces in paths Use underscores instead of spaces in paths Jul 26, 2023
@hugovk hugovk marked this pull request as draft July 31, 2023 16:47
@ezio-melotti
Copy link
Member

ezio-melotti commented Oct 12, 2023

Is something still blocking this PR?

@hugovk
Copy link
Member Author

hugovk commented Oct 12, 2023

Yes, python/core-workflow#499 needs merging first.

@ezio-melotti
Copy link
Member

Is something blocking python/core-workflow#499? 🙃

@hugovk
Copy link
Member Author

hugovk commented Oct 12, 2023

Someone to hit the big green merge button? I think it's ready.

templates/add_blurb.html Outdated Show resolved Hide resolved
@hugovk
Copy link
Member Author

hugovk commented Jul 7, 2024

I've released blurb 1.2.0 that now uses underscores for the directories:

https://github.com/python/blurb/releases/tag/v1.2.0

Let's give it a little bit of time for testing first, then we can mark this as ready for review/merge.

templates/add_blurb.html Outdated Show resolved Hide resolved
templates/add_blurb.html Outdated Show resolved Hide resolved
hugovk and others added 2 commits July 8, 2024 04:19
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Éric <merwok@netwok.org>
@hugovk hugovk marked this pull request as ready for review July 13, 2024 09:40
@hugovk
Copy link
Member Author

hugovk commented Jul 19, 2024

Let's give it a little bit of time for testing first, then we can mark this as ready for review/merge.

This is now ready for review/merge.

After it's merged and we've confirmed it's working, I'll post on Discuss to encourage people to upgrade their blurb CLI.

Further down the line, we can add a pre-commit check to prevent creation of dirs with spaces.

@hugovk
Copy link
Member Author

hugovk commented Jul 25, 2024

We already have an approval, let's merge! 🚀

@hugovk hugovk merged commit 91ccfb7 into python:main Jul 25, 2024
9 checks passed
@hugovk hugovk deleted the no-spaces branch July 25, 2024 15:59
@hugovk
Copy link
Member Author

hugovk commented Jul 25, 2024

Confirmed working: python/cpython@4ea1895 (#122242) 🚀

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.

4 participants