-
Notifications
You must be signed in to change notification settings - Fork 970
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
#1316 Update packaging-projects.rst with a tip on good module naming #1424
base: main
Are you sure you want to change the base?
Conversation
IMO, this is a lot of information for a tutorial. Most users should be following the tutorial, which tells them what to name the files. This is more "guide-like" / advanced information. I think a simple 1-2 sentence warning about folder needing underscores to be importable is fine. (99.9% of users don't need to know about a workaround to import something with a dash in it). In fact, the design of stubs packages with |
Hello @henryiii :) I agree there is a lot of informations but I placed it at the end of the tutorial so that it does not overwhelm a person that just wants to follow the tutorial. Moreover, I think it is useful to have "hubs of links with a small dive on a topic" somewhere. Best regards, |
I completely agree with @henryiii. @LLyaudet Please refer to the Diataxis documentation process which we use: https://diataxis.fr/tutorials/ Specifically: """ If the learner doesn’t need an explanation in order to complete the tutorial, don’t explain. Also see: https://devguide.python.org/documentation/style-guide/#audience Moreover, having module names that are not valid Python identifiers is an extremely niche use case. I don't think it should be mentioned even in guides outside the tutorial. We should just make it clear that project names are not restricted to be Python identifiers, unlike module names. |
Hello @jeanas :) I don't know what kind of pedagogy study supports this: If the learner doesn’t need an explanation in order to complete the tutorial, don’t explain.
Please be specific. The tone of this link is contemptuous on some part. Best regards, |
The quote is not implying that documentation should only offer minimum explanation, only that the tutorial should remain minimal, as an entry point for absolute beginners, and all more advanced explanations should live in guides or discussions, with the TOC serving as your “hub of links”. This is merely a way to structure documentation, there are other ways but Diataxis happens to have been chosen for packaging.python.org. I think that (a) the info you are proposing to add here should not live in the tutorial but in an explanation, following Diataxis, and (b) part of it (specifically, anything related to modules with names that aren't valid Python identifiers) should be stripped.
Second and third paragraphs. The second asks to “save details for the how-to guides and other sources”. The third paragraph might sound contemptuous as phrased there, and it is not my intent to express contempt against you, but I do think this is a case of trying to improve the documentation in a way that would have helped you avoid some problem but where that problem isn't actually common. What you see is that you would have benefited from this note. What you may not see is that there are dozens and dozens of other notes of equal or greater importance that could be added to the tutorial, but adding them would make the tutorial difficult to use. |
xref: #1425 |
Hello @jeanas ,
Ok, as I commented I was open to have my redaction submitted in this PR moved to a discussion/advanced tutorial, so point (a) is ok with me, if there is at least a small warning with link like "See here for an advanced discussion on package names" in source/tutorials/packaging-projects.rst. But I have see that you somehow decreased the need for that with #1425 and #1426. But I do not see any valid reason for your point (b). Let's cite the third paragraph so that navigating is not needed:
And your answer :
Sorry but I cannot accept this is the right way to see the problem and I still have doubts about your intent. Best regards, |
Moreover, there was no vindication when I opened #1316. |
I'm sorry but it would simply take me more time than I have to formulate a thoughtful response (esp. given the "doubt about my intent"). I'm going to just let people with commit access decide what to do with this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the attempt to improve this tutorial! We can't accept this change as is, though.
This change is made to a tutorial document, but this document type is expected to include simple instructions exclusively, exactly as is, without any deviations. It probably fits guides or discussions better. Frankly, #1425 is probably what the guide needs instead.
I'm also concerned that this mostly duplicates the explanation of how Python itself works, which isn't directly related to packaging.
Like many other projects over at least half a decade, we're doing our best to follow the Diátaxis framework for writing technical documentation. I witnessed it gaining a rising popularity since at least 2018, since it's formalized and preached by a respected member of the Python community. Some projects/organizations have their own variants of techwriting guidelines that mostly resemble Diátaxis or are direct derivatives of it.
In PyPUG, we also aspire to follow it. Please, refer to https://diataxis.fr which has a lot of information about the different aspects of using it.
Moreover, you can find the author on the Write The Docs Slack instance where there's a corresponding channel: https://www.writethedocs.org/slack/. Daniele is quite responsive there, and this place has a very high concentration of experienced techwriters, exchanging ideas and discussing practical applications of this framework and other things (in separate channels).
I'm afraid, this issue is not a place for debating what Diátaxis got right and wrong. What's important here is that the maintainers and frequent contributors agree that this is the way to go and everybody is expected to respect the convention.
Hello, |
I wouldn't say so. The references are invalid (they must be identifiers Sphinx understands, not filenames). The location of the changes hasn't changed either. Both are hard blockers. |
…packaging-projects.
for more information, see https://pre-commit.ci
Hello,
Sorry, I corrected the references. It should be ok now. Best regards, |
Hello :), I tried to follow your suggestions but it is now slightly conflicting. Best regards, |
@LLyaudet Thanks for working on this. Clearly we are not sure under what form this topic should appear in the guide and where. I believe @henryiii wanted only to extract it out of the "packaging tutorial", which is now done, so it is good. And I believe @webknjaz would prefer not to have two "discussion" documents on the same topic (#1426). So my suggestion is to make it into some kind of short "how-to guide" document (I suggested "tutorial" in an earlier comment, but I meant "guide"). This way we would have a tutorial, a specification, a discussion, and finally a guide (which is what Diataxis is all about). If we can agree on this, then we still need to find a nice way to structure and phrase all of this. Maybe @willingc can help with this part. |
|
||
This discussion is a complement to :doc:`/tutorials/packaging-projects`. | ||
|
||
Make sure to have a valid :ref:`Python identifier <python:identifiers>` for your import package/module name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to have a valid :ref:`Python identifier <python:identifiers>` for your import package/module name. | |
Make sure to choose a valid :ref:`Python identifier <python:identifiers>` for the names of all your :term:`import packages <import package>` and :term:`modules <module>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late answer. I validated your commit suggestion of the 4th. The 3rd december I modified like this:
Make sure to have a valid :ref:`Python identifier <python:identifiers>` for your import package/module name.
The (PyPI) :term:`project<Project>`/:term:`distribution package <Distribution Package>` name
and the Python :term:`import package <Import Package>`/module may differ slightly.
So the terms are already referenced.
I found it nice to have all 3 terms referenced in the same sentence when I modified.
But I understand the need to reference one of the 3 terms in the preceding sentence since it is asked here:
packaging.python.org/source/contribute.rst
Line 255 in e8a9716
The first time you mention a tool or practice, link to the part of the |
I have a question: Should I reference the glossary on each appearance of a term in the same document?
I know that when a document is long, it is nice when you can hover over any acronym and check again its meaning if it does not stuck the first time.
I think on Wikipedia, it is frequent that most occurrences are cross-links.
As of now, I kept the second reference in the following sentence.
Let me know if I should remove it.
Moreover, if there is a consensus on this question, I think it should be in contribute.rst :)
Hello :), Thanks for the suggestions @sinoroc :). Best regards, |
Hello :), I finished analyzing the build results in testpypa. The following applies to my test but may differ in other contexts. When the correct import package is found, it is always leaved as is (no normalisation): no lowercase, no underscore instead of dash.
I tried to be synthetic and group similar results. It can replace "Hatch will recognize that the module corresponding to the package is I'll try to improve the PR tomorrow :). Best regards, |
Correction of two code-blocks python -> pycon after suggestion from #1424
Co-authored-by: sinoroc <5529267+sinoroc@users.noreply.github.com>
Co-authored-by: sinoroc <5529267+sinoroc@users.noreply.github.com>
Hello :), Sorry for the delay. I have reopened a conversation where I applied your commit suggestion, since I have a question for best practices regarding term references (only one per document or for each occurrence). Apart from that, I included the results of my testing of the 4 build backends covered in the tutorial. I build the doc with nox and everything is ok. If you do not mind, I would like to know if it is ok to move again the document as is from discussions/ to guides/. Best regards, |
Sorry, this got auto-closed because I wrote "Fixes #1424" in #1426 while I meant "Supersedes #1424". Reopening. I do think that the info added in #1426 (now here) is sufficient, but I will leave it to committers to choose whether to continue this, or to re-close it and also close the associated issue #1316. |
Hello :), |
📚 Documentation preview 📚: https://python-packaging-user-guide--1424.org.readthedocs.build/en/1424/discussions/choosing-a-module-name/