Skip to content

Conversation

@hugovk
Copy link
Member

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-melottiezio-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=awaitutil.get_misc_news_filename(issue_number, section, news_entry)

and then used to create the filename in:

asyncdefget_misc_news_filename(issue_number, section, body):
date=time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
nonce=awaitnonceify(body)
path=f"Misc/NEWS.d/next/{section}/{date}.gh-issue-{issue_number}.{nonce}.rst"
returnpath

There is only a test for this function:

asyncdeftest_get_misc_news_filename():
path=awaitutil.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
MemberAuthor

Sure, updated!

@hugovk
Copy link
MemberAuthor

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

@AlexWaygoodAlexWaygood changed the title Use dashes instead of spaces in pathsUse underscores instead of spaces in pathsJul 26, 2023
@hugovkhugovk 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
MemberAuthor

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

@ezio-melotti
Copy link
Member

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

@hugovk
Copy link
MemberAuthor

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

@hugovk
Copy link
MemberAuthor

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.

hugovkand others added 2 commits July 8, 2024 04:19
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Éric <merwok@netwok.org>
@hugovkhugovk marked this pull request as ready for review July 13, 2024 09:40
@hugovk
Copy link
MemberAuthor

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
MemberAuthor

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

@hugovkhugovk merged commit 91ccfb7 into python:mainJul 25, 2024
@hugovkhugovk deleted the no-spaces branch July 25, 2024 15:59
@hugovk
Copy link
MemberAuthor

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

Sign up for freeto 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

@hugovk@ezio-melotti@merwok@Mariatta