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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

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.

@@ -38,7 +38,7 @@ <h3>📜🤖 Blurb it again?</h3>
<select id="section" name="section" class="form-control form-inline" required>
<option></option>
<option>Security</option>
<option>Core and Builtins</option>
<option>Core_and_Builtins</option>
Copy link
Member

Choose a reason for hiding this comment

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

Would it be good to use underscores in the option value and spaces in the human-readable text?

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.

None yet

4 participants