Skip to content

Commit 770f398

Browse files
authored
enh: adhere to style guide and reorg landing (#598)
* enh: adhere to style guide and reorg landing * links * Apply suggestion from @lwasser
1 parent d81cf26 commit 770f398

13 files changed

+369
-313
lines changed
220 KB
Binary file not shown.
203 KB
Binary file not shown.

_static/pyos.css

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
--pyos-color-secondary: #8045e5;
55
--pyos-color-secondary-highlight: #591bc2;
66
--pyos-color-tertiary: #a66c98;
7-
--pyos-color-dark: #542568;
7+
--pyos-color-dark: #33205c; /* Brand dark purple - #33205c */
88
--pyos-color-light: #daabcf;
99

1010
/* Darkmode Adjustments*/
1111
--pyos-dm-color-primary: #c483e0;
1212

1313
/* Fonts (overrides base theme) */
1414
--pst-font-family-heading: "Poppins", sans-serif;
15-
--pst-font-family-base: "Poppins", sans-serif;
16-
--pyos-font-family-h1: "Itim", serif;
15+
--pst-font-family-base: "NunitoSans", sans-serif;
16+
--pyos-font-family-h1: "Poppins", sans-serif;
17+
--pst-font-family-heading-weight: 400;
1718
}
1819

1920
/* anything related to the dark theme */
@@ -32,6 +33,17 @@ body {
3233
font-size: 1rem;
3334
}
3435

36+
/* nav bar poppins font */
37+
.bd-header,
38+
.bd-header .navbar-nav,
39+
.bd-header .navbar-nav .nav-link,
40+
.bd-header .navbar-header-items,
41+
.bd-header .navbar-item,
42+
.navbar-item .nav-item {
43+
font-family: "Poppins", sans-serif !important;
44+
font-weight: 400 !important;
45+
}
46+
3547
/* Allow the center content to expand to wide on wide screens */
3648
@media (min-width: 960px) {
3749
.bd-page-width {
@@ -65,6 +77,10 @@ body p {
6577
margin-bottom: 70px !important;
6678
}
6779

80+
.admonition-title {
81+
font-family: "Poppins", sans-serif !important;
82+
}
83+
6884
h1 {
6985
margin-top: 10px;
7086
margin-bottom: 40px;
@@ -73,6 +89,7 @@ h1 {
7389
}
7490
h2 {
7591
margin-top: 1em;
92+
color: var(--pyos-h1-color);
7693
}
7794

7895
h3 {
@@ -94,7 +111,9 @@ figcaption {
94111
}
95112

96113
.admonition p {
97-
font-size: 0.9em;
114+
font-size: 0.95em;
115+
font-family: Poppins, sans-serif;
116+
font-weight: 200;
98117
}
99118

100119
/* Navbar */
@@ -198,12 +217,14 @@ html[data-theme="light"] {
198217
--pst-color-success-text: #fff;
199218
--pst-color-success-highlight: #00381a;
200219
--sd-color-success: var(--pst-color-success);
220+
--pst-color-link: #735fab;
221+
--pst-color-link-hover: #591bc2;
201222
--sd-color-success-text: var(--pst-color-success-text);
202223
--sd-color-success-highlight: var(--pst-color-success-highlight);
203224
--sd-color-success-bg: #d6ece1;
204225
--sd-color-success-bg-text: #14181e;
205-
--pst-color-info: #a66c98; /* general admonition */
206-
--pst-color-info-bg: #eac8e2;
226+
--pst-color-info: #33205c; /* general admonition */
227+
--pst-color-info-bg: #bab3d4;
207228
--pst-heading-color: var(--pyos-color-dark);
208229
--pyos-h1-color: var(--pyos-color-dark);
209230
}
@@ -318,6 +339,25 @@ See https://github.com/pydata/pydata-sphinx-theme/pull/1784
318339
font-weight: 600;
319340
src: url("./fonts/poppins-v20-latin-600.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
320341
}
342+
343+
/* nunitosans-regular - latin */
344+
@font-face {
345+
font-display: swap;
346+
font-family: "NunitoSans";
347+
font-style: normal;
348+
font-weight: 400;
349+
src: url("./fonts/NunitoSans-VariableFont.woff2") format("woff2");
350+
}
351+
352+
/* nunitosans-italic - latin */
353+
@font-face {
354+
font-display: swap;
355+
font-family: "NunitoSans";
356+
font-style: italic;
357+
font-weight: 400;
358+
src: url("./fonts/NunitoSans-Italic-VariableFont.woff2") format("woff2");
359+
}
360+
321361
/* Cards */
322362

323363
/* todo light and dark adaptations needed */
@@ -329,6 +369,7 @@ See https://github.com/pydata/pydata-sphinx-theme/pull/1784
329369
border-bottom: 2px solid #999;
330370
font-size: 1.2rem;
331371
font-weight: 600 !important;
372+
font-family: "Poppins", sans-serif !important;
332373
}
333374

334375
.sd-card-header {

package-structure-code/code-style-linting-format.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python Package Code Style, Format and Linters
22

3-
```{admonition} Take Aways
3+
:::{admonition} Take Aways
44

55
* pyOpenSci requires authors to follow PEP 8 code format guidelines
66
* Setting up a code formatters like Black and isort will help you enforce PEP 8 style guidelines and also consistent, readable code format
@@ -9,7 +9,7 @@
99
each time you make a commit.
1010
* [precommit.ci](https://pre-commit.ci/) is a bot that you can add to your GitHub repository. It will automagically apply code format to every PR using the tools specified in your pre-commit-config.yaml file. It can save significant time and make contributions easier for new contributors.
1111
* Automation is good! By making code quality tools care of your code, you can focus on structural and high values tasks.
12-
```
12+
:::
1313

1414
Consistent code format and style is useful to both your package
1515
and across the scientific Python ecosystem because using similar
@@ -35,6 +35,7 @@ a discussion of:
3535
1. Setting up pre-commit hooks and the pre-commit.ci bot to make using code
3636
format tools in daily workflows and in pull requests on GitHub easier.
3737

38+
(code-style-tools)=
3839
## Use a code format tool (or tools) to make your life easier
3940

4041
We suggest that you use a code format tool, or a set of format tools, because
@@ -57,18 +58,18 @@ the work out of manually implementing code format requirements.
5758
Consistent code format across packages within the (scientific) Python ecosystem,
5859
will also broadly make code easier to scan, understand and contribute to.
5960

60-
## Linting vs format and style
61+
## Linting vs. format and style
6162

6263
Before we dive in let's get a few definitions out of the way.
6364

64-
### Code Linting
65+
### Code linting
6566

6667
A code linter is a tool that will review your code and
6768
identify errors or issues. A linter typically does not modify your code. It
6869
will tell you what the error is and on what line it was discovered. Flake8,
6970
discussed below, is an example of a commonly-used code linter.
7071

71-
### Code Formatters (and stylers)
72+
### Code formatters (and stylers)
7273

7374
Code formatters will reformat your code for you. Python focused code formatters
7475
often follow PEP 8 standards. However, they also make stylistic decisions about
@@ -82,6 +83,7 @@ You will learn more about Black below.
8283

8384
## Code linting, formatting and styling tools
8485

86+
(about-black)=
8587
### Black
8688

8789
[Black](https://black.readthedocs.io/en/stable/) is a code
@@ -94,14 +96,15 @@ some exceptions. A few examples of those exceptions are below:
9496
- Black will not adjust line length in your comments or docstrings.
9597
- This tool will not review and fix import order (you need `isort` or `ruff` to do that - see below).
9698

97-
```{tip}
99+
:::{tip}
98100
If you are interested in seeing how Black will format your code, you can
99101
use the [Black playground](https://black.vercel.app/)
100-
```
102+
:::
101103

102104
Using a code formatter like Black will leave you more time to work on
103105
code function rather than worry about format.
104106

107+
(about-flake8)=
105108
### Flake8
106109

107110
To adhere to Python `pep8` format standards, you might want to add
@@ -186,6 +189,7 @@ Python file `temporal.py` imports after `isort` has been run
186189
:end-before: def calc_annual_mean
187190
:::
188191

192+
(about-ruff)=
189193
### Ruff
190194

191195
[Ruff](https://docs.astral.sh/ruff/) is a new addition to the code quality
@@ -272,13 +276,13 @@ on your the code files in your commit. It will update any files to match
272276
black format standards. You can then retype the commit and push files to
273277
GitHub that have been formatted by black. -->
274278

275-
```{important}
279+
:::{important}
276280
If have a Python code-base and multiple maintainers actively working
277281
on the code, and you intend to run a tool like Black, be sure to coordinate across your team. An initial commit that
278282
applies Black to your entire package will likely change a significant amount of
279283
your code. This could lead to merge conflicts on open and new PR's before the
280284
new changes are merged.
281-
```
285+
:::
282286

283287
## General pre commit checks
284288

package-structure-code/complex-python-package-builds.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
This guide is focused on packages that are either pure-python or that
44
have a few simple extensions in another language such as C or C++.
55

6-
In the future, we want to provide resources for packaging workflows that require more complex builds. If you have questions about these types of package, please [add a question to our discourse](https://pyopensci.discourse.group/) or open an [issue about this guide specifically in the GitHub repo for this guide](https://github.com/pyOpenSci/python-package-guide/issues). There are many nuances to building and distributing Python packages that have compiled extensions requiring non-Python dependencies at build time. For an overview and thorough discussion of these nuances, please see [this site.](https://pypackaging-native.github.io/)
6+
For comprehensive guidance on packaging compiled projects with C/C++/Fortran/Rust extensions, see the [Scientific Python Development Guide on compiled packaging](https://learn.scientific-python.org/development/guides/packaging-compiled/). This is the best reference for complex builds and covers scikit-build-core, meson-python, maturin, and other modern build backends.
77

8-
## Pure Python Packages vs. packages with extensions in other languages
8+
If you have questions about these types of package, please open an [issue about this guide specifically in the GitHub repo for this guide](https://github.com/pyOpenSci/python-package-guide/issues). There are many nuances to building and distributing Python packages that have compiled extensions requiring non-Python dependencies at build time. For an overview and thorough discussion of these nuances, please see [this site.](https://pypackaging-native.github.io/)
9+
10+
## Pure Python packages vs. packages with extensions in other languages
911

1012
You can classify Python package complexity into three general categories. These
1113
categories can in turn help you select the correct package frontend and

0 commit comments

Comments
 (0)