Skip to content

Commit

Permalink
Enh: Add infrastructure to support a new packaging page
Browse files Browse the repository at this point in the history
A new section on our website!! learn is next
  • Loading branch information
lwasser committed Jan 30, 2024
2 parents 045757c + bd6d5c7 commit f0a49a6
Show file tree
Hide file tree
Showing 22 changed files with 355 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-site.yml
Expand Up @@ -35,4 +35,4 @@ jobs:
arguments: |
--ignore-urls "https://fonts.googleapis.com,https://fonts.gstatic.com,_site/_posts/README/index.html"
--ignore-files "/.+\/_posts\/README.md"
--ignore-status-codes "0,403, 429, 503, 999"
--ignore-status-codes "0, 200, 403, 429, 503, 999"
4 changes: 4 additions & 0 deletions _config.yml
Expand Up @@ -245,6 +245,10 @@ whitelist:
- jekyll-redirect-from

collections:
packaging:
people: true
tutorials:
people: true
packages:
output: true
permalink: /:collection/:path/
Expand Down
18 changes: 14 additions & 4 deletions _data/navigation.yml
Expand Up @@ -9,15 +9,25 @@ main:
- title: "Community partners"
icon:
url: "/partners.html"
- title: "Accepted packages"
icon:
url: "/python-packages/"
- title: "Peer review guide"
url: "https://www.pyopensci.org/software-peer-review/"
icon: "fas fa-external-link-alt"
- title: "Python package guide"
- title: "Python Packaging"
icon: "fas fa-fw fa-envelope-square"
url:
sub-nav:
- title: "Packaging resources"
icon:
url: "python-packaging-science.html"
- title: "Our packages"
icon:
url: "/python-packages/"
- title: "Package Guidebook"
url: "https://www.pyopensci.org/python-package-guide/"
icon: "fas fa-external-link-alt"
- title: "Our packages"
icon: "fas fa-fw fa-envelope-square"
url: "/python-packages/index.html"
- title: "Blog"
url: "/blog/index.html"
- title: "Community"
Expand Down
2 changes: 1 addition & 1 deletion _includes/feature_row
Expand Up @@ -14,7 +14,7 @@
{% endif %}
{% if f.image_path %}
<div class="archive__item-teaser">
<img src="{{ f.image_path | relative_url }}"
<img src="{{ f.image_path | relative_url }}" {% if f.image_size %} style="width:{{ f.image_size }};"{% endif %}
alt="{% if f.alt %}{{ f.alt }}{% endif %}">
{% if f.image_caption %}
<span class="archive__item-caption">{{ f.image_caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>
Expand Down
27 changes: 27 additions & 0 deletions _includes/tutorial-grid.html
@@ -0,0 +1,27 @@

<article class="card" itemscope="" itemtype="https://schema.org/CreativeWork">
<div class="content">
<div class="title-block">
<h4 class="title" itemprop="headline">{{ atutorial.title }}</h4>
</div>
{% if atutorial.excerpt %}
<p class="excerpt">
{{ atutorial.excerpt }}
</p>
{% endif %}

{% if atutorial.subpages %}
<ul>
{% for page in atutorial.subpages %}
<li>
<a href="{{ page.url }}">{{ page.name }}</a>
</li>
{% endfor %}
</ul>

{% endif %}
</div>
{% if atutorial.link %}
<a href="{{ atutorial.link }}" class="btn {{ atutorial.btn_class }}"><i class="fa-solid fa-magnifying-glass"></i> {{ atutorial.btn_label }}</a>
{% endif %}
</article>
16 changes: 16 additions & 0 deletions _packaging/documentation.md
@@ -0,0 +1,16 @@
---
title: "Document your Python package"
excerpt: "Learn about best practices for developing documentation for your Python package."
learning_objectives:
subpages:
- name: Documentation Overview
url: https://www.pyopensci.org/python-package-guide/documentation/index.html#
- name: Create your docs
url: https://www.pyopensci.org/python-package-guide/documentation/write-user-documentation/get-started.html
- name: Create package tutorials
url: https://www.pyopensci.org/python-package-guide/documentation/write-user-documentation/create-package-tutorials.html
- name: Document your code (API docs)
url: https://www.pyopensci.org/python-package-guide/documentation/write-user-documentation/document-your-code-api-docstrings.html

url:
---
15 changes: 15 additions & 0 deletions _packaging/packaging.md
@@ -0,0 +1,15 @@
---
title: "Create Python package structure"
excerpt: "Learn about the best way to create your Python package."
subpages:
- name: The structure of a Python package
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html
- name: Add metadata - pyproject.toml file
url: https://www.pyopensci.org/python-package-guide/package-structure-code/pyproject-toml-python-package-metadata.html
- name: Declare package dependencies
url: https://www.pyopensci.org/python-package-guide/package-structure-code/declare-dependencies.html
- name: Get to know the ecosystem of Python packaging tools
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-build-tools.html
- name: Complete package builds
url: https://www.pyopensci.org/python-package-guide/package-structure-code/complex-python-package-builds.html
---
16 changes: 16 additions & 0 deletions _packaging/publish-python-package.md
@@ -0,0 +1,16 @@
---
title: "Publish your Python package"
excerpt: "
Learn more about the publishing options for your Python package including publishing on PyPI and the conda-forge channel of conda."
learning_objectives:
subpages:
- name: Build your package for PyPI publication
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-distribution-files-sdist-wheel.html
- name: Publish to PyPI and Conda
url: https://www.pyopensci.org/python-package-guide/package-structure-code/publish-python-package-pypi-conda.html#
- name: Versioning your package
url: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-versions.html
- name: Code style and format
url: https://www.pyopensci.org/python-package-guide/package-structure-code/code-style-linting-format.html
url:
---
18 changes: 18 additions & 0 deletions _packaging/tests.md
@@ -0,0 +1,18 @@
---
title: "Python package tests"
excerpt: "
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."
learning_objectives:
subpages:
- name: Introduction to writing tests
url: https://www.pyopensci.org/python-package-guide/tests/index.html
- name: Write tests for your Python package
url: https://www.pyopensci.org/python-package-guide/tests/write-tests.html
- name: Three types of types for your Python package
url: https://www.pyopensci.org/python-package-guide/tests/test-types.html
- name: Run tests locally
url: https://www.pyopensci.org/python-package-guide/tests/run-tests.html
- name: Run tests online using Continuous Integration
url: https://www.pyopensci.org/python-package-guide/tests/tests-ci.html
url:
---
1 change: 1 addition & 0 deletions _pages/home.md
@@ -1,6 +1,7 @@
---
layout: splash
title: "Welcome to pyOpenSci"
excerpt: "We support the scientific Python tools that drive open science through peer review, training and community building."
author_profile: false
published: true
site-map: true
Expand Down
113 changes: 113 additions & 0 deletions _pages/packaging-resources.md
@@ -0,0 +1,113 @@
---
layout: splash
classes: flowing
permalink: /python-packaging-science.html
title: "Python packaging resources for scientists"
excerpt: "We make the scientific Python package ecosystem easier to navigate through peer review and packaging resources."
header:
overlay_image: images/header.jpg
overlay_filter: 0.8
intro:
- 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."
peer-review:
- image_path: images/pyopensci-people-at-computer.jpg
alt: "A pencil sketch of a round table with people from different backgrounds sitting around it, working on laptops and also writing together."
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."
title: Raising the bar for scientific Python software"
url: https://www.pyopensci.org/about-peer-review/index.html
btn_label: Learn more and get involved with peer review today.
btn_class: btn--primary
packaging-easier:
- image_path: images/pyopensci-working-together.png
alt: "A black and grey sketch of a group of people sitting at a desk in front of a monitor smiling."
title: "Get Involved: Help us improve our scientific Python packaging resources"
excerpt: "
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:
* Opening an issue about problems that you find in our guidebook
* Submitting a pull request that fixes a typo or mistake in the guide.
* Get credit for your contribution
All contributions are recognized both on our website and in the guidebook's citation.
"
url: https://github.com/pyOpenSci/python-package-guide/pulls
btn_label: <i class="fa-solid fa-arrow-up-right-from-square"></i> See what we're working on now
btn_class: btn--success
community-created:
- image_path: images/pyopensci-people-working-together.png
image_size: 500px
alt: "A group of people working on a tetris like set of building blocks, trying to stack the blocks together. "
title: "Community-created Python Packaging Guide"
excerpt: "
Our packaging guide is a living document that will help you navigate the Python packaging ecosystem and learn about modern Python packaging best practices.
* Created & curated by the community
* Reviewed by beginner to expert level Pythonistas
* Accurate, modern & beginner-friendly
All contributions are recognized both on our website and in the guidebook's citation.
"
toc: false
---

{% include feature_row id="intro" type="center" %}

<div class="pyos-section purple">
<div class="content" markdown="1">

{% include feature_row id="community-created" type="right" %}

<div class="subsection" markdown="1">
### Scientific Python packaging guidebook sections

<div class="tutorial__container">
{% for atutorial in site.packaging %}
{% include tutorial-grid.html %}
{% endfor %}
</div>

</div>
<div class="clearfix"></div>

</div>
</div>

{% include div_purple_bottom.html %}

<div class="pyos-section">
<div class="content" markdown="1">

## Beginner friendly Python packaging tutorials

Beginner-friendly Python packaging tutorials that will take you through
the full process of creating a Python package, following modern best
practices.

<div class="tutorial__container">
{% for atutorial in site.tutorials %}
{% include tutorial-grid.html %}
{% endfor %}
</div>

<div class="clearfix"></div>

</div>
</div>

{% include div_purple_top.html %}

<div class="pyos-section purple" markdown="1">
<div class="content" markdown="1">
{% include feature_row id="packaging-easier" type="left" %}

</div>
</div>


{% include div_purple_bottom.html %}
8 changes: 8 additions & 0 deletions _pages/tutorials.md
@@ -0,0 +1,8 @@
---
title: Scientific Python tutorials
layout: collection
permalink: /tutorials/
collection: portfolio
entries_layout: grid
classes: wide
---
1 change: 1 addition & 0 deletions _sass/minimal-mistakes.scss
Expand Up @@ -50,3 +50,4 @@
@import "minimal-mistakes/pyos-twitter";
@import "minimal-mistakes/pyos-grid";
@import "minimal-mistakes/pyos-flowing-page";
@import "minimal-mistakes/pyos-cards";
79 changes: 79 additions & 0 deletions _sass/minimal-mistakes/_pyos-cards.scss
@@ -0,0 +1,79 @@
.tutorial {
font-size: 1em;

& p.page__meta {
padding-top: 1.3em;
}
}

.card .page__meta {
font-size:5em!important;
}

.tutorial__container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); // Adjust the minmax values as needed
grid-gap: 20px;

// Ensure all cards have the height of the tallest card
align-items: stretch;

.card {
font-size: .8em;
display: flex;
flex-direction: column;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

.excerpt {
font-size: 1em;
padding: 1em;
}
h4.title {
color: rgb(84, 38, 104)!important;
font-size: 1.3em;
margin: 0;
}
.title-block {
background-color: #F7F2E2;
display: flex;
height: auto;
padding: 1.2em;
border-bottom: #555 2px solid;
}

img {
width: 100%;
height: auto;
}

.content {
flex: 1;
}
ul li {
font-size: .9em;
margin: 0 0 .5em 0;
}
ul {
padding-right: .05em;
padding-bottom: .2em;
}
}

}


.btn--success{
color: #000!important;
}


.subsection {
padding: 0 2em;

h3 {
padding-left: 0.5em;
}
}
1 change: 1 addition & 0 deletions _sass/minimal-mistakes/_pyos-dropdown.scss
Expand Up @@ -28,6 +28,7 @@
margin-right: auto;
display: block;
max-height: 3rem!important;
box-shadow: none!important;
}


Expand Down
6 changes: 5 additions & 1 deletion _sass/minimal-mistakes/_pyos-grid.scss
@@ -1,4 +1,8 @@

.clearfix::after {
content: "";
display: table;
clear: both;
}

/* Create & style a 3x3 grid wrapper */
.grid {
Expand Down
2 changes: 1 addition & 1 deletion _sass/minimal-mistakes/_variables.scss
Expand Up @@ -89,7 +89,7 @@ $form-background-color: $lighter-gray !default;
$footer-background-color: $lighter-gray !default;

$primary-color: #6f777d !default;
$success-color: #3fa63f !default;
$success-color: #81c0aa !default;
$warning-color: #d67f05 !default;
$danger-color: #ee5f5b !default;
$info-color: #320e5b !default;
Expand Down

0 comments on commit f0a49a6

Please sign in to comment.