Skip to content

Commit f0a49a6

Browse files
authored
Enh: Add infrastructure to support a new packaging page
A new section on our website!! learn is next
2 parents 045757c + bd6d5c7 commit f0a49a6

22 files changed

+355
-8
lines changed

.github/workflows/build-site.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
arguments: |
3636
--ignore-urls "https://fonts.googleapis.com,https://fonts.gstatic.com,_site/_posts/README/index.html"
3737
--ignore-files "/.+\/_posts\/README.md"
38-
--ignore-status-codes "0,403, 429, 503, 999"
38+
--ignore-status-codes "0, 200, 403, 429, 503, 999"

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ whitelist:
245245
- jekyll-redirect-from
246246

247247
collections:
248+
packaging:
249+
people: true
250+
tutorials:
251+
people: true
248252
packages:
249253
output: true
250254
permalink: /:collection/:path/

_data/navigation.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,25 @@ main:
99
- title: "Community partners"
1010
icon:
1111
url: "/partners.html"
12+
- title: "Accepted packages"
13+
icon:
14+
url: "/python-packages/"
1215
- title: "Peer review guide"
1316
url: "https://www.pyopensci.org/software-peer-review/"
1417
icon: "fas fa-external-link-alt"
15-
- title: "Python package guide"
18+
- title: "Python Packaging"
19+
icon: "fas fa-fw fa-envelope-square"
20+
url:
21+
sub-nav:
22+
- title: "Packaging resources"
23+
icon:
24+
url: "python-packaging-science.html"
25+
- title: "Our packages"
26+
icon:
27+
url: "/python-packages/"
28+
- title: "Package Guidebook"
1629
url: "https://www.pyopensci.org/python-package-guide/"
1730
icon: "fas fa-external-link-alt"
18-
- title: "Our packages"
19-
icon: "fas fa-fw fa-envelope-square"
20-
url: "/python-packages/index.html"
2131
- title: "Blog"
2232
url: "/blog/index.html"
2333
- title: "Community"

_includes/feature_row

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{% endif %}
1515
{% if f.image_path %}
1616
<div class="archive__item-teaser">
17-
<img src="{{ f.image_path | relative_url }}"
17+
<img src="{{ f.image_path | relative_url }}" {% if f.image_size %} style="width:{{ f.image_size }};"{% endif %}
1818
alt="{% if f.alt %}{{ f.alt }}{% endif %}">
1919
{% if f.image_caption %}
2020
<span class="archive__item-caption">{{ f.image_caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>

_includes/tutorial-grid.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
<article class="card" itemscope="" itemtype="https://schema.org/CreativeWork">
3+
<div class="content">
4+
<div class="title-block">
5+
<h4 class="title" itemprop="headline">{{ atutorial.title }}</h4>
6+
</div>
7+
{% if atutorial.excerpt %}
8+
<p class="excerpt">
9+
{{ atutorial.excerpt }}
10+
</p>
11+
{% endif %}
12+
13+
{% if atutorial.subpages %}
14+
<ul>
15+
{% for page in atutorial.subpages %}
16+
<li>
17+
<a href="{{ page.url }}">{{ page.name }}</a>
18+
</li>
19+
{% endfor %}
20+
</ul>
21+
22+
{% endif %}
23+
</div>
24+
{% if atutorial.link %}
25+
<a href="{{ atutorial.link }}" class="btn {{ atutorial.btn_class }}"><i class="fa-solid fa-magnifying-glass"></i> {{ atutorial.btn_label }}</a>
26+
{% endif %}
27+
</article>

_packaging/documentation.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "Document your Python package"
3+
excerpt: "Learn about best practices for developing documentation for your Python package."
4+
learning_objectives:
5+
subpages:
6+
- name: Documentation Overview
7+
url: https://www.pyopensci.org/python-package-guide/documentation/index.html#
8+
- name: Create your docs
9+
url: https://www.pyopensci.org/python-package-guide/documentation/write-user-documentation/get-started.html
10+
- name: Create package tutorials
11+
url: https://www.pyopensci.org/python-package-guide/documentation/write-user-documentation/create-package-tutorials.html
12+
- name: Document your code (API docs)
13+
url: https://www.pyopensci.org/python-package-guide/documentation/write-user-documentation/document-your-code-api-docstrings.html
14+
15+
url:
16+
---

_packaging/packaging.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Create Python package structure"
3+
excerpt: "Learn about the best way to create your Python package."
4+
subpages:
5+
- name: The structure of a Python package
6+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html
7+
- name: Add metadata - pyproject.toml file
8+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/pyproject-toml-python-package-metadata.html
9+
- name: Declare package dependencies
10+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/declare-dependencies.html
11+
- name: Get to know the ecosystem of Python packaging tools
12+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-build-tools.html
13+
- name: Complete package builds
14+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/complex-python-package-builds.html
15+
---

_packaging/publish-python-package.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "Publish your Python package"
3+
excerpt: "
4+
Learn more about the publishing options for your Python package including publishing on PyPI and the conda-forge channel of conda."
5+
learning_objectives:
6+
subpages:
7+
- name: Build your package for PyPI publication
8+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-distribution-files-sdist-wheel.html
9+
- name: Publish to PyPI and Conda
10+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/publish-python-package-pypi-conda.html#
11+
- name: Versioning your package
12+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-versions.html
13+
- name: Code style and format
14+
url: https://www.pyopensci.org/python-package-guide/package-structure-code/code-style-linting-format.html
15+
url:
16+
---

_packaging/tests.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Python package tests"
3+
excerpt: "
4+
Learn more about the importance of writing tests for your Python package and how you can setup infrastructure to run your tests both locally and on GitHub."
5+
learning_objectives:
6+
subpages:
7+
- name: Introduction to writing tests
8+
url: https://www.pyopensci.org/python-package-guide/tests/index.html
9+
- name: Write tests for your Python package
10+
url: https://www.pyopensci.org/python-package-guide/tests/write-tests.html
11+
- name: Three types of types for your Python package
12+
url: https://www.pyopensci.org/python-package-guide/tests/test-types.html
13+
- name: Run tests locally
14+
url: https://www.pyopensci.org/python-package-guide/tests/run-tests.html
15+
- name: Run tests online using Continuous Integration
16+
url: https://www.pyopensci.org/python-package-guide/tests/tests-ci.html
17+
url:
18+
---

_pages/home.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: splash
33
title: "Welcome to pyOpenSci"
4+
excerpt: "We support the scientific Python tools that drive open science through peer review, training and community building."
45
author_profile: false
56
published: true
67
site-map: true

_pages/packaging-resources.md

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
layout: splash
3+
classes: flowing
4+
permalink: /python-packaging-science.html
5+
title: "Python packaging resources for scientists"
6+
excerpt: "We make the scientific Python package ecosystem easier to navigate through peer review and packaging resources."
7+
header:
8+
overlay_image: images/header.jpg
9+
overlay_filter: 0.8
10+
intro:
11+
- excerpt: "There are many tools and approaches that can be used to create a Python package. We build resources that help you both understand the tool ecosystem and also learn how to create a Python package using modern best practices."
12+
peer-review:
13+
- image_path: images/pyopensci-people-at-computer.jpg
14+
alt: "A pencil sketch of a round table with people from different backgrounds sitting around it, working on laptops and also writing together."
15+
excerpt: "We run an open peer review process for scientific Python software. Peer review helps maintainers improve the quality, usability and long-term maintainability of scientific software."
16+
title: Raising the bar for scientific Python software"
17+
url: https://www.pyopensci.org/about-peer-review/index.html
18+
btn_label: Learn more and get involved with peer review today.
19+
btn_class: btn--primary
20+
packaging-easier:
21+
- image_path: images/pyopensci-working-together.png
22+
alt: "A black and grey sketch of a group of people sitting at a desk in front of a monitor smiling."
23+
title: "Get Involved: Help us improve our scientific Python packaging resources"
24+
excerpt: "
25+
We need your help! Our packaging content is community-created and reviewed through an open review process on GitHub. The more feedback that we get, the more useful our resources are to the community. Get involved by:
26+
27+
* Opening an issue about problems that you find in our guidebook
28+
29+
* Submitting a pull request that fixes a typo or mistake in the guide.
30+
31+
* Get credit for your contribution
32+
33+
34+
All contributions are recognized both on our website and in the guidebook's citation.
35+
"
36+
url: https://github.com/pyOpenSci/python-package-guide/pulls
37+
btn_label: <i class="fa-solid fa-arrow-up-right-from-square"></i> See what we're working on now
38+
btn_class: btn--success
39+
community-created:
40+
- image_path: images/pyopensci-people-working-together.png
41+
image_size: 500px
42+
alt: "A group of people working on a tetris like set of building blocks, trying to stack the blocks together. "
43+
title: "Community-created Python Packaging Guide"
44+
excerpt: "
45+
Our packaging guide is a living document that will help you navigate the Python packaging ecosystem and learn about modern Python packaging best practices.
46+
47+
* Created & curated by the community
48+
49+
* Reviewed by beginner to expert level Pythonistas
50+
51+
* Accurate, modern & beginner-friendly
52+
53+
54+
All contributions are recognized both on our website and in the guidebook's citation.
55+
"
56+
toc: false
57+
---
58+
59+
{% include feature_row id="intro" type="center" %}
60+
61+
<div class="pyos-section purple">
62+
<div class="content" markdown="1">
63+
64+
{% include feature_row id="community-created" type="right" %}
65+
66+
<div class="subsection" markdown="1">
67+
### Scientific Python packaging guidebook sections
68+
69+
<div class="tutorial__container">
70+
{% for atutorial in site.packaging %}
71+
{% include tutorial-grid.html %}
72+
{% endfor %}
73+
</div>
74+
75+
</div>
76+
<div class="clearfix"></div>
77+
78+
</div>
79+
</div>
80+
81+
{% include div_purple_bottom.html %}
82+
83+
<div class="pyos-section">
84+
<div class="content" markdown="1">
85+
86+
## Beginner friendly Python packaging tutorials
87+
88+
Beginner-friendly Python packaging tutorials that will take you through
89+
the full process of creating a Python package, following modern best
90+
practices.
91+
92+
<div class="tutorial__container">
93+
{% for atutorial in site.tutorials %}
94+
{% include tutorial-grid.html %}
95+
{% endfor %}
96+
</div>
97+
98+
<div class="clearfix"></div>
99+
100+
</div>
101+
</div>
102+
103+
{% include div_purple_top.html %}
104+
105+
<div class="pyos-section purple" markdown="1">
106+
<div class="content" markdown="1">
107+
{% include feature_row id="packaging-easier" type="left" %}
108+
109+
</div>
110+
</div>
111+
112+
113+
{% include div_purple_bottom.html %}

_pages/tutorials.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Scientific Python tutorials
3+
layout: collection
4+
permalink: /tutorials/
5+
collection: portfolio
6+
entries_layout: grid
7+
classes: wide
8+
---

_sass/minimal-mistakes.scss

+1
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@
5050
@import "minimal-mistakes/pyos-twitter";
5151
@import "minimal-mistakes/pyos-grid";
5252
@import "minimal-mistakes/pyos-flowing-page";
53+
@import "minimal-mistakes/pyos-cards";
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.tutorial {
2+
font-size: 1em;
3+
4+
& p.page__meta {
5+
padding-top: 1.3em;
6+
}
7+
}
8+
9+
.card .page__meta {
10+
font-size:5em!important;
11+
}
12+
13+
.tutorial__container {
14+
display: grid;
15+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); // Adjust the minmax values as needed
16+
grid-gap: 20px;
17+
18+
// Ensure all cards have the height of the tallest card
19+
align-items: stretch;
20+
21+
.card {
22+
font-size: .8em;
23+
display: flex;
24+
flex-direction: column;
25+
background-color: #fff;
26+
border: 1px solid #ddd;
27+
border-radius: 8px;
28+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
29+
30+
.excerpt {
31+
font-size: 1em;
32+
padding: 1em;
33+
}
34+
h4.title {
35+
color: rgb(84, 38, 104)!important;
36+
font-size: 1.3em;
37+
margin: 0;
38+
}
39+
.title-block {
40+
background-color: #F7F2E2;
41+
display: flex;
42+
height: auto;
43+
padding: 1.2em;
44+
border-bottom: #555 2px solid;
45+
}
46+
47+
img {
48+
width: 100%;
49+
height: auto;
50+
}
51+
52+
.content {
53+
flex: 1;
54+
}
55+
ul li {
56+
font-size: .9em;
57+
margin: 0 0 .5em 0;
58+
}
59+
ul {
60+
padding-right: .05em;
61+
padding-bottom: .2em;
62+
}
63+
}
64+
65+
}
66+
67+
68+
.btn--success{
69+
color: #000!important;
70+
}
71+
72+
73+
.subsection {
74+
padding: 0 2em;
75+
76+
h3 {
77+
padding-left: 0.5em;
78+
}
79+
}

_sass/minimal-mistakes/_pyos-dropdown.scss

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
margin-right: auto;
2929
display: block;
3030
max-height: 3rem!important;
31+
box-shadow: none!important;
3132
}
3233

3334

_sass/minimal-mistakes/_pyos-grid.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
1+
.clearfix::after {
2+
content: "";
3+
display: table;
4+
clear: both;
5+
}
26

37
/* Create & style a 3x3 grid wrapper */
48
.grid {

_sass/minimal-mistakes/_variables.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ $form-background-color: $lighter-gray !default;
8989
$footer-background-color: $lighter-gray !default;
9090

9191
$primary-color: #6f777d !default;
92-
$success-color: #3fa63f !default;
92+
$success-color: #81c0aa !default;
9393
$warning-color: #d67f05 !default;
9494
$danger-color: #ee5f5b !default;
9595
$info-color: #320e5b !default;

0 commit comments

Comments
 (0)