Skip to content

Commit 0457e8a

Browse files
committed
Update layout and readme
1 parent 969f8b3 commit 0457e8a

File tree

2 files changed

+63
-9
lines changed

2 files changed

+63
-9
lines changed

README.md

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,73 @@ This will create two files in the `dist/` directory:
142142

143143
### 4. Publish to PyPI
144144

145-
Install twine if you haven't already:
145+
**Option A: Install in current environment**
146+
147+
Note that the latest twine and readme-renderer require `docutils>=0.21.2`, which conflicts with Sphinx's requirement for `docutils<0.21`. First, upgrade pip and setuptools, then install compatible versions:
148+
149+
```bash
150+
pip install --upgrade pip setuptools wheel
151+
pip install --upgrade importlib_metadata
152+
pip install 'twine<5.0' 'readme-renderer<44.0'
153+
```
154+
155+
**Option B: Use a separate environment (recommended)**
156+
157+
This avoids all dependency conflicts.
158+
159+
For conda users:
160+
161+
```bash
162+
conda create -n publish_env python=3.10
163+
conda activate publish_env
164+
pip install --upgrade pip setuptools wheel
165+
pip install build twine
166+
```
167+
168+
For venv users:
146169

147170
```bash
148-
pip install twine
171+
python -m venv publish_env
172+
source publish_env/bin/activate # On Windows: publish_env\Scripts\activate
173+
pip install --upgrade pip setuptools wheel
174+
pip install build twine
149175
```
150176

177+
**Authentication Setup**
178+
179+
Before publishing, you need to set up authentication:
180+
181+
1. Create accounts:
182+
- TestPyPI: https://test.pypi.org/account/register/
183+
- PyPI: https://pypi.org/account/register/
184+
185+
2. Create API tokens:
186+
- TestPyPI token: https://test.pypi.org/manage/account/token/
187+
- PyPI token: https://pypi.org/manage/account/token/
188+
189+
3. Configure `~/.pypirc`:
190+
191+
```ini
192+
[distutils]
193+
index-servers =
194+
pypi
195+
testpypi
196+
197+
[testpypi]
198+
repository = https://test.pypi.org/legacy/
199+
username = __token__
200+
password = pypi-YOUR-TESTPYPI-TOKEN-HERE
201+
202+
[pypi]
203+
repository = https://pypi.org/legacy/
204+
username = __token__
205+
password = pypi-YOUR-PYPI-TOKEN-HERE
206+
```
207+
208+
Replace `pypi-YOUR-TESTPYPI-TOKEN-HERE` and `pypi-YOUR-PYPI-TOKEN-HERE` with your actual tokens.
209+
210+
**Publishing**
211+
151212
For testing, publish to TestPyPI first:
152213

153214
```bash

pytorch_sphinx_theme2/templates/layout.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@
147147
</script>
148148

149149
<script async src="https://cse.google.com/cse.js?cx=e65585f8c3ea1440e"></script>
150-
{% if release == "main" %}
151-
<!--
152-
Search engines should not index the main version of documentation.
153-
Stable documentation are built without release == 'main'.
154-
-->
155-
<meta name="robots" content="noindex">
156-
{% endif %}
157150
{{ super() }}
158151
{% endblock%}
159152

0 commit comments

Comments
 (0)