-
-
Notifications
You must be signed in to change notification settings - Fork 853
Define port for htmllive to avoid collisions #1327
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
Conversation
Makefile
Outdated
@@ -170,7 +170,7 @@ htmlview: html | |||
|
|||
.PHONY: htmllive | |||
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild | |||
htmllive: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" --open-browser --delay 0 | |||
htmllive: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" --open-browser --delay 0 --port 55311 |
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.
I would add a comment to specify that you picked it randomly.
Are you going to pick random ones for the other repos too?
Would it be better to just pick a range and have e.g. 55300 for cpython, 55301 for the devguide, and so on?
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.
I would add a comment to specify that you picked it randomly.
Will do.
Are you going to pick random ones for the other repos too?
Yes, I added a random one for PEPs here: python/peps#3792
I made sure it started with a 5 here, and a 6 there.
I wasn't going to add one for CPython, at least not yet. I figured that it should be fine with the default. Although it could clash with other default servers (e.g. python -m http.server
), if it comes up with any regularity, we could use one beginning with 4.
Would it be better to just pick a range and have e.g. 55300 for cpython, 55301 for the devguide, and so on?
I don't know, can change if you'd prefer.
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.
The reason why I'm asking these questions, is that seeing an arbitrary number like 55311 makes me wonder if it's some specific port that was picked for some specific reason.
Seeing other random ports in other projects will make this even more puzzling. Adding comments will solve this concern, but also having a range of consecutive numbers will help clarify implicitly that the numbers themselves are not special.
I would also change the last digit rather than first, for two reasons:
- after you used 4, 5, and 6, you will have to start reusing one of those;
- having consecutive values helps indicate that it's just an incrementing sequence of arbitrary ports;
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.
Sounds reasonable to me 👍
Updated, how's this look?
Co-authored-by: Ezio Melotti <[email protected]>
It's not unusual that I might run
make htmllive
for a pair of CPython docs, devguide and PEPs at the same time.To avoid clashes, use a randomly-chosen "ephemeral port" between 49152–65535 for the local server for each of devguide and PEPs.
Also use the more descriptive Sphinx long options (added in 7.3.0) for the Makefiles.
See also python/peps#3792.
📚 Documentation preview 📚: https://cpython-devguide--1327.org.readthedocs.build/