Skip to content

Commit 3fdfff9

Browse files
committed
Final edits to intro page
1 parent 9cb2474 commit 3fdfff9

File tree

7 files changed

+138
-74
lines changed

7 files changed

+138
-74
lines changed

_static/pyos.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ html, body {
99
}
1010
}
1111

12-
/* Make sure the header nav is centered - not sure why it's not overriding*/
12+
/* Make sure the header nav is centered */
1313
.navbar-header-items .me-auto, .me-auto .navbar-header-items__center {
1414
margin-left: auto!important;
1515
margin-right: auto!important;
@@ -35,6 +35,13 @@ html, body {
3535
margin-right: auto!important;
3636
}
3737

38+
/* custom fonts */
39+
40+
html, body {
41+
font-size: 1.02rem;
42+
font-family: 'Poppins', sans-serif!important;
43+
}
44+
3845
body p {
3946
}
4047

_templates/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- custom head content-->
2+
23
<link rel="preconnect" href="https://fonts.googleapis.com">
34
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
45
<link href="https://fonts.googleapis.com/css2?family=Itim&family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">

_templates/nav.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>this is a test does it work?</p>
-53.2 KB
Binary file not shown.
306 KB
Loading

tutorials/6-publish-pypi.md

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
# Publish your Python package to PyPI
22

3+
<!-- TODOs:
34
4-
In the previous lessons, you've learned the following:
5+
* mention twine keyring - - https://twine.readthedocs.io/en/stable/#keyring-support
6+
* emphasize that we recommended the trusted publisher github action for most maintainers
57
6-
1. How to structure your code into a package like format that can be installed into a Python environment.
7-
2. How to add a `README` and `LICENSE` file to your package
8-
3. How to setup your `pyproject.toml` file with all of the metadata that PyPI requires and also metadata that will be helpful for users to find your package.
8+
TODO: Go back to pyproj toml lesson and add a dev dependencies section with build and twine so they can just pip install -e .[dev] into their environment and be done
99
10-
If you have gone through all of the above lessons, you are now ready to
11-
build your package's distribution files which are needed for you to publish
12-
to PyPI. Here, you will learn:
10+
`pip install build`
11+
-->
1312

14-
* How to set up your account and package on PyPI and
15-
* How to manually publish to (test) PyPI using [twine](https://twine.readthedocs.io/en/stable/).
1613

17-
In a followup lesson, you will learn how to automate publishing to PyPI using GitHub actions.
14+
In the previous lessons, you've learned:
1815

16+
1. How to make your code pip installable.
17+
2. How to add a `README`, `LICENSE` & `CODE of CONDUCT` file file to your package
18+
3. How to setup your `pyproject.toml` file to support publishing on PyPI.
1919

2020
:::{admonition} Learning Objectives
2121
:class: tip
2222

2323
In this lesson you will learn how to:
2424

25-
- How to build your package's sdist and wheel distributions
25+
- How to build your package's source (sdist) and wheel distributions
2626
- Setup an account on testPyPI (the process is similar for the real PyPI)
27-
- Publish your package to testPyPI
27+
- Publish your package to testPyPI using [twine](https://twine.readthedocs.io/en/stable/)
2828

2929
Once your package is on PyPI you can then easily publish it to conda-forge
3030
using the [grayskull](https://conda.github.io/grayskull/) tool. You do not need to build the package specifically
3131
for conda, conda-forge will build from your PyPI source distribution file (sdist). You will learn how to publish to conda-forge in the [next lesson](7-publish-conda-forge.md).
3232

33+
In a followup lesson, you will learn how to automate publishing to PyPI using GitHub actions.
3334
:::
3435

3536
:::{figure-md} build-workflow-tutorial
@@ -41,9 +42,7 @@ You need to build your Python package in order to publish it to PyPI (or Conda).
4142
<!-- Pypa resource: https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives
4243
https://spdx.org/licenses/PSF-2.0.html (double check that we can use language from pypa tutorial??
4344
44-
4545
https://packaging.python.org/en/latest/guides/using-testpypi/
46-
4746
-->
4847

4948
## Test PyPI.org vs PyPI
@@ -57,7 +56,7 @@ The steps for publishing on test PyPI vs. real PyPI are the same with the
5756
exception of a different url. Thus, in this lesson you will use testPyPI
5857
to practice and learn.
5958

60-
<!-- in xx lesson, you will learn how to setup an automated release workflow on GitHub
59+
<!-- Add when this lesson is created - in xx lesson, you will learn how to setup an automated release workflow on GitHub
6160
using GitHub actions that will automate the PyPI publication process whenever
6261
you create a new software release. -->
6362

@@ -125,8 +124,7 @@ files. This process is known as building your package.
125124

126125

127126

128-
<!-- ?? TODO: Go back to pyproj lesson and add a dev dependencies with build and twine?
129-
`pip install build` -->
127+
130128

131129
3. You are now ready to build your package! Note that here you are using the [PyPA build tool](https://github.com/pypa/build) as a "Front end" tool that builds
132130
your package's sdist and wheel using the hatchling build back end. Remember that you defined your build backend here in the build system table of your `pyproject.toml` file. So build knows to use [hatchling](https://hatch.pypa.io/latest/).
@@ -175,7 +173,7 @@ lesson.
175173
You've now created your package distribution. You're officially on
176174
your way to publishing your package on PyPI.
177175

178-
## 2. Setup your testPyPI account
176+
## Step 2. Setup your testPyPI account
179177

180178
Next, you'll setup an account on `testPyPI`. Remember that you
181179
are using testPyPI here instead of the real PyPI as a way to
@@ -212,7 +210,7 @@ While you don't have to setup 2-factor authentication, we strongly
212210
suggest that you do so.
213211
:::
214212

215-
## 3. Create a package upload token
213+
## Step 3. Create a package upload token
216214

217215
To upload your package to PyPI, you will need to create a token. Ideally
218216
this token is specific to the package that you are publishing.
@@ -269,6 +267,7 @@ NOTE: the `.pypirc` file stores your token in plain text format. Thus, in anothe
269267
:::
270268

271269

270+
:::{admonition} using a .pypirc file if your always publishing manually
272271
### Create your `.pypirc` file with authentication information
273272

274273
To create your `.pypirc` file, do the following.
@@ -297,6 +296,8 @@ Save the file and then check that it looks correct in bash using the `cat` comma
297296
$ cat ~/.pypirc
298297
```
299298

299+
:::
300+
300301
Now, install twine:
301302

302303
::::{tab-set}
@@ -436,6 +437,23 @@ you wish to install your newly published package in.
436437
::::
437438

438439

440+
:::{admonition} The value of end-to-end tools like hatch, flit and poetry
441+
In this lesson we are using core tools including:
442+
443+
* hatchling
444+
* PyPA's build
445+
* twine
446+
447+
to build and publish your package to PyPI.
448+
449+
End-to-end packaging tools such as Hatch, PDM, Poetry and
450+
Flit can manage all of the above steps but have to be
451+
configured.
452+
453+
For example, while twine users a `.pypirc` file, Hatch will cache your PyPI token information to make publishing to PyPI from your computer easier. Be sure the read the documentation for any end-to-end publication tool that you chose to use.
454+
:::
455+
456+
439457
<!-- TODO: venv will always be different for windows - do we need a third tab?? Also is conda different on windows? i forget -->
440458

441459
<!--TODO: teach them to setup trusted publisher for actions... in the actions lesson
@@ -455,7 +473,8 @@ related to PyPI publication.
455473
You will learn how to create the automated trusted publisher workflow in a followup lesson.
456474

457475

458-
### If you want to use a manual token-based publication workflow
476+
### OPTIONAL: If you want to use a manual token-based publication workflow
477+
459478
If you plan to use your token regularly to publish to PyPI, we strongly recommend going through the above steps again to create
460479
a token specific to your new package.
461480

@@ -470,22 +489,6 @@ To do this:
470489

471490
And you're all done!
472491

473-
:::{admonition} The value of end-to-end tools like hatch, flit and poetry
474-
In this lesson we are using core tools including:
475-
476-
* hatchling
477-
* PyPA's build
478-
* twine
479-
480-
to build and publish your package to PyPI.
481-
482-
End-to-end packaging tools such as Hatch, PDM, Poetry and
483-
Flit can manage all of the above steps but have to be
484-
configured.
485-
486-
For example, while twine users a `.pypirc` file, Hatch will cache your PyPI token information to make publishing to PyPI from your computer easier. Be sure the read the documentation for any end-to-end publication tool that you chose to use.
487-
:::
488-
489492
## You have published your package to (test) PyPI!
490493

491494
Congratulations. You have now successfully published your package to testPyPI. If you have a package that is ready for real-world use on the real pyPi, then you can follow the same steps to publish it on PyPI.org .

0 commit comments

Comments
 (0)