Skip to content

Commit 1076550

Browse files
authored
Merge branch 'main' into issue-236-config-and-enable-vale-in-pre-commit
2 parents 0602e7a + e5d7ff4 commit 1076550

24 files changed

+454
-142
lines changed

.all-contributorsrc

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,105 @@
533533
"code",
534534
"review"
535535
]
536+
},
537+
{
538+
"login": "kenseehart",
539+
"name": "Ken Seehart",
540+
"avatar_url": "https://avatars.githubusercontent.com/u/612119?v=4",
541+
"profile": "https://github.com/kenseehart",
542+
"contributions": [
543+
"code",
544+
"review"
545+
]
546+
},
547+
{
548+
"login": "ryanskeith",
549+
"name": "Ryan",
550+
"avatar_url": "https://avatars.githubusercontent.com/u/657220?v=4",
551+
"profile": "https://github.com/ryanskeith",
552+
"contributions": [
553+
"code",
554+
"review"
555+
]
556+
},
557+
{
558+
"login": "pb-413",
559+
"name": "Patrick Byers",
560+
"avatar_url": "https://avatars.githubusercontent.com/u/36516871?v=4",
561+
"profile": "https://github.com/pb-413",
562+
"contributions": [
563+
"code",
564+
"review"
565+
]
566+
},
567+
{
568+
"login": "sosey",
569+
"name": "Megan Sosey",
570+
"avatar_url": "https://avatars.githubusercontent.com/u/503615?v=4",
571+
"profile": "http://www.stsci.edu/",
572+
"contributions": [
573+
"code",
574+
"review"
575+
]
576+
},
577+
{
578+
"login": "BSuperbad",
579+
"name": "Brianne Wilhelmi",
580+
"avatar_url": "https://avatars.githubusercontent.com/u/100496041?v=4",
581+
"profile": "https://github.com/BSuperbad",
582+
"contributions": [
583+
"code",
584+
"review"
585+
]
586+
},
587+
{
588+
"login": "chenghlee",
589+
"name": "Cheng H. Lee",
590+
"avatar_url": "https://avatars.githubusercontent.com/u/3485949?v=4",
591+
"profile": "https://github.com/chenghlee",
592+
"contributions": [
593+
"code",
594+
"review"
595+
]
596+
},
597+
{
598+
"login": "Vaunty",
599+
"name": "Vaunty",
600+
"avatar_url": "https://avatars.githubusercontent.com/u/68826427?v=4",
601+
"profile": "https://github.com/Vaunty",
602+
"contributions": [
603+
"code",
604+
"review"
605+
]
606+
},
607+
{
608+
"login": "zackw",
609+
"name": "Zack Weinberg",
610+
"avatar_url": "https://avatars.githubusercontent.com/u/325899?v=4",
611+
"profile": "https://www.owlfolio.org/",
612+
"contributions": [
613+
"review"
614+
]
615+
},
616+
{
617+
"login": "flpm",
618+
"name": "Felipe Moreno",
619+
"avatar_url": "https://avatars.githubusercontent.com/u/17676929?v=4",
620+
"profile": "http://flpm.dev",
621+
"contributions": [
622+
"review",
623+
"code"
624+
]
625+
},
626+
{
627+
"login": "sn3hay",
628+
"name": "Sneha Yadav",
629+
"avatar_url": "https://avatars.githubusercontent.com/u/156010030?v=4",
630+
"profile": "https://github.com/sn3hay",
631+
"contributions": [
632+
"code",
633+
"review"
634+
]
536635
}
537636
],
538637
"contributorsPerLine": 7,

.github/workflows/build-book.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
build-test-book:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919

2020
- name: Setup Python
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: '3.9'
2424

@@ -31,7 +31,7 @@ jobs:
3131
run: echo "::set-output name=dir::$(pip cache dir)"
3232

3333
- name: Cache dependencies
34-
uses: actions/cache@v2
34+
uses: actions/cache@v4
3535
with:
3636
path: ${{ steps.pip-cache.outputs.dir }}
3737
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Save html as artifact
4848
- name: Save book html as artifact for viewing
49-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5050
with:
5151
name: book-html
5252
path: |

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <img src="https://www.pyopensci.org/images/logo.png" width=100 /> pyOpenSci scientific Python Packaging Guide
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
[![All Contributors](https://img.shields.io/badge/all_contributors-51-orange.svg?style=flat-square)](#contributors-)
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-61-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55

66
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pyopensci/python-package-guide?color=purple&display_name=tag&style=plastic)
@@ -140,6 +140,18 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
140140
<tr>
141141
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/tylerjbonnell/"><img src="https://avatars.githubusercontent.com/u/89505514?v=4?s=100" width="100px;" alt="Tyler Bonnell"/><br /><sub><b>Tyler Bonnell</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=Tyler-Bonnell" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3ATyler-Bonnell" title="Reviewed Pull Requests">👀</a></td>
142142
<td align="center" valign="top" width="14.28%"><a href="http://www.linkedin.com/pub/pat-tressel/2/b6/610"><img src="https://avatars.githubusercontent.com/u/618916?v=4?s=100" width="100px;" alt="Pat Tressel"/><br /><sub><b>Pat Tressel</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=ptressel" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Aptressel" title="Reviewed Pull Requests">👀</a></td>
143+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kenseehart"><img src="https://avatars.githubusercontent.com/u/612119?v=4?s=100" width="100px;" alt="Ken Seehart"/><br /><sub><b>Ken Seehart</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=kenseehart" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Akenseehart" title="Reviewed Pull Requests">👀</a></td>
144+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ryanskeith"><img src="https://avatars.githubusercontent.com/u/657220?v=4?s=100" width="100px;" alt="Ryan"/><br /><sub><b>Ryan</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=ryanskeith" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Aryanskeith" title="Reviewed Pull Requests">👀</a></td>
145+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pb-413"><img src="https://avatars.githubusercontent.com/u/36516871?v=4?s=100" width="100px;" alt="Patrick Byers"/><br /><sub><b>Patrick Byers</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=pb-413" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Apb-413" title="Reviewed Pull Requests">👀</a></td>
146+
<td align="center" valign="top" width="14.28%"><a href="http://www.stsci.edu/"><img src="https://avatars.githubusercontent.com/u/503615?v=4?s=100" width="100px;" alt="Megan Sosey"/><br /><sub><b>Megan Sosey</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=sosey" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Asosey" title="Reviewed Pull Requests">👀</a></td>
147+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/BSuperbad"><img src="https://avatars.githubusercontent.com/u/100496041?v=4?s=100" width="100px;" alt="Brianne Wilhelmi"/><br /><sub><b>Brianne Wilhelmi</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=BSuperbad" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3ABSuperbad" title="Reviewed Pull Requests">👀</a></td>
148+
</tr>
149+
<tr>
150+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chenghlee"><img src="https://avatars.githubusercontent.com/u/3485949?v=4?s=100" width="100px;" alt="Cheng H. Lee"/><br /><sub><b>Cheng H. Lee</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=chenghlee" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Achenghlee" title="Reviewed Pull Requests">👀</a></td>
151+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Vaunty"><img src="https://avatars.githubusercontent.com/u/68826427?v=4?s=100" width="100px;" alt="Vaunty"/><br /><sub><b>Vaunty</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=Vaunty" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3AVaunty" title="Reviewed Pull Requests">👀</a></td>
152+
<td align="center" valign="top" width="14.28%"><a href="https://www.owlfolio.org/"><img src="https://avatars.githubusercontent.com/u/325899?v=4?s=100" width="100px;" alt="Zack Weinberg"/><br /><sub><b>Zack Weinberg</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Azackw" title="Reviewed Pull Requests">👀</a></td>
153+
<td align="center" valign="top" width="14.28%"><a href="http://flpm.dev"><img src="https://avatars.githubusercontent.com/u/17676929?v=4?s=100" width="100px;" alt="Felipe Moreno"/><br /><sub><b>Felipe Moreno</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Aflpm" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/pyOpenSci/python-package-guide/commits?author=flpm" title="Code">💻</a></td>
154+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sn3hay"><img src="https://avatars.githubusercontent.com/u/156010030?v=4?s=100" width="100px;" alt="Sneha Yadav"/><br /><sub><b>Sneha Yadav</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=sn3hay" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Asn3hay" title="Reviewed Pull Requests">👀</a></td>
143155
</tr>
144156
</tbody>
145157
</table>

documentation/repository-files/readme-file-best-practices.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sees before they install your package.
66

77
The README.md file is the landing page of:
88

9-
* Your package as it appears on a repository site such as PyPI or Anaconda
9+
* Your package as it appears on a repository site such as PyPI or Anaconda.org
1010
* Your package's GitHub repository
1111

1212
Your README.md file is also used as a measure of package and community
@@ -68,7 +68,7 @@ README file for others to quickly browse.
6868

6969
Some badges that you might consider adding to your README file include:
7070

71-
* Current version of the package on PyPI / Anaconda Cloud
71+
* Current version of the package on PyPI / Anaconda.org
7272

7373
Example: [![PyPI version shields.io](https://img.shields.io/pypi/v/pandera.svg)](https://pypi.org/project/pandera/)
7474

@@ -114,7 +114,7 @@ file.
114114
### ✔️ Installation instructions
115115

116116
Include instructions for installing your package. If you have published
117-
the package on both PyPI and Anaconda Cloud be sure to include instructions for both.
117+
the package on both PyPI and Anaconda.org, be sure to include instructions for both.
118118

119119
### ✔️ Document any additional setup required
120120

examples/extension-hatch/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
An example Python package used to support Python packaging tutorials
2+
3+
This project demonstrates mixing C and Python code by using the frontend hatch with the backend mesonpy
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .temperature import celsius_to_fahrenheit, fahrenheit_to_celsius
2+
3+
__all__ = ["celsius_to_fahrenheit", "fahrenheit_to_celsius"]
4+
__version__ = "0.1.0dev0"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
py.extension_module(
2+
'temperature',
3+
'temperature.c',
4+
install: true,
5+
subdir: 'examplePy'
6+
)
7+
8+
python_sources = [
9+
'__init__.py'
10+
]
11+
12+
py.install_sources(
13+
python_sources,
14+
subdir: 'examplePy'
15+
)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#define PY_SSIZE_T_CLEAN
2+
#include <Python.h>
3+
4+
static PyObject *
5+
temperature_celsius_to_fahrenheit(PyObject *self, PyObject *args)
6+
{
7+
long celsius;
8+
long fahrenheit;
9+
PyObject *ret;
10+
11+
if (!PyArg_ParseTuple(args, "l", &celsius))
12+
return NULL;
13+
14+
fahrenheit = (celsius * 9/5) + 32;
15+
16+
ret = PyLong_FromLong(fahrenheit);
17+
Py_INCREF(ret);
18+
return ret;
19+
}
20+
21+
static PyObject *
22+
temperature_fahrenheit_to_celsius(PyObject *self, PyObject *args)
23+
{
24+
long fahrenheit;
25+
long celsius;
26+
PyObject *ret;
27+
28+
if (!PyArg_ParseTuple(args, "l", &fahrenheit))
29+
return NULL;
30+
31+
celsius = (fahrenheit - 32) * 9/5;
32+
33+
ret = PyLong_FromLong(celsius);
34+
Py_INCREF(ret);
35+
return ret;
36+
}
37+
38+
static PyMethodDef CoreMethods[] = {
39+
{"celsius_to_fahrenheit", temperature_celsius_to_fahrenheit, METH_VARARGS, "Convert temperature from Celsius to Fahrenheit"},
40+
{"fahrenheit_to_celsius", temperature_fahrenheit_to_celsius, METH_VARARGS, "Convert temperature from Fahrenheit to Celsius"},
41+
{NULL, NULL, 0, NULL} /* Sentinel */
42+
};
43+
44+
static struct PyModuleDef temperaturemodule = {
45+
PyModuleDef_HEAD_INIT,
46+
"temperature", /* name of module */
47+
NULL, /* module documentation, may be NULL */
48+
-1, /* size of per-interpreter state of the module,
49+
or -1 if the module keeps state in global variables. */
50+
CoreMethods
51+
};
52+
53+
PyMODINIT_FUNC
54+
PyInit_temperature(void)
55+
{
56+
PyObject *m;
57+
58+
m = PyModule_Create(&temperaturemodule);
59+
if (m == NULL)
60+
return NULL;
61+
62+
return m;
63+
}

examples/extension-hatch/meson.build

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
project(
2+
'examplePy',
3+
'c',
4+
version: '0.1.dev0',
5+
license: 'MIT',
6+
meson_version: '>= 0.64.0',
7+
default_options: [
8+
'buildtype=debugoptimized',
9+
'c_std=c99',
10+
'cpp_std=c++14',
11+
],
12+
)
13+
14+
cc = meson.get_compiler('c')
15+
16+
py_mod = import('python')
17+
py = py_mod.find_installation(pure: false)
18+
py_dep = py.dependency()
19+
20+
subdir('examplePy')
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[build-system]
2+
build-backend = "mesonpy"
3+
requires = [
4+
"meson-python>=0.13.0rc0",
5+
]
6+
7+
[project]
8+
name = "examplePy"
9+
version = "0.1"
10+
authors = [
11+
{name = "Some Maintainer", email = "some-email@pyopensci.org"},
12+
]
13+
maintainers = [
14+
{name = "All the contributors"},
15+
]
16+
description = "An example Python package used to support Python packaging tutorials"
17+
keywords = ["pyOpenSci", "python packaging"]
18+
readme = "README"
19+
classifiers = [
20+
"Programming Language :: Python :: 3",
21+
"License :: OSI Approved :: BSD License",
22+
"Operating System :: OS Independent",
23+
]

0 commit comments

Comments
 (0)