Skip to content

Commit 53e28f4

Browse files
committed
Merge remote-tracking branch 'origin/main' into template-publish
2 parents 7ca0eeb + 954d80a commit 53e28f4

19 files changed

Lines changed: 758 additions & 12 deletions

.circleci/config.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# See: https://circleci.com/docs/2.0/language-python/
2+
3+
version: 2.1
4+
jobs:
5+
build:
6+
docker:
7+
- image: cimg/python:3.11
8+
9+
steps:
10+
- checkout
11+
12+
- run:
13+
name: Update apt-get
14+
command: |
15+
sudo apt-get update
16+
17+
- restore_cache:
18+
keys:
19+
- pip-cache-v1
20+
21+
- run:
22+
name: Clone website
23+
command: git clone git@github.com:scientific-python/devstats.scientific-python.org.git
24+
25+
- run:
26+
name: Install Python dependencies
27+
command: |
28+
python3 -m venv venv
29+
source venv/bin/activate
30+
pip install --upgrade pip wheel setuptools
31+
pip install -r devstats.scientific-python.org/requirements.txt
32+
pip list
33+
34+
- save_cache:
35+
key: pip-cache-v1
36+
paths:
37+
- ~/.cache/pip
38+
39+
- run:
40+
name: Install
41+
command: |
42+
source venv/bin/activate
43+
pip install -e .
44+
pip list
45+
46+
- run:
47+
name: Build docs
48+
command: |
49+
# NOTE: bad interaction w/ blas multithreading on circleci
50+
export OMP_NUM_THREADS=1
51+
source venv/bin/activate
52+
cd devstats.scientific-python.org
53+
make html
54+
55+
- store_artifacts:
56+
path: devstats.scientific-python.org/_build/html

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
labels:
8+
- "type: Maintenance"
9+
- package-ecosystem: "pip"
10+
directory: "/"
11+
schedule:
12+
interval: "monthly"
13+
labels:
14+
- "type: Maintenance"

.github/workflows/circleci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: circleci
2+
3+
on: [status]
4+
jobs:
5+
documentation:
6+
runs-on: ubuntu-latest
7+
name: Run CircleCI documentation artifact redirector
8+
steps:
9+
- name: GitHub Action step
10+
uses: larsoner/circleci-artifacts-redirector-action@master
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
api-token: ${{ secrets.DEVSTATS_CIRCLECI_TOKEN }}
14+
artifact-path: 0/_build/html/index.html
15+
circleci-jobs: documentation

.github/workflows/label-check.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Labels
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- labeled
8+
- unlabeled
9+
10+
env:
11+
LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}
12+
13+
jobs:
14+
check-type-label:
15+
name: ensure type label
16+
runs-on: ubuntu-latest
17+
steps:
18+
- if: "contains( env.LABELS, 'type: ' ) == false"
19+
run: exit 1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Milestone
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
branches:
8+
- "main"
9+
10+
jobs:
11+
milestone_pr:
12+
name: attach to PR
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: scientific-python/attach-next-milestone-action@f94a5235518d4d34911c41e19d780b8e79d42238
16+
with:
17+
token: ${{ secrets.MILESTONE_LABELER_TOKEN }}
18+
force: true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include CHANGELOG.md

RELEASE.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
Example `version`
5+
Example `version number`
66

77
- 1.8.dev0 # development version of 1.8 (release candidate 1)
88
- 1.8rc1 # 1.8 release candidate 1
@@ -12,21 +12,29 @@ Example `version`
1212

1313
## Process
1414

15-
- Update and review `CHANGELOG.md`:
15+
- Set release variables:
1616

17-
gem install github_changelog_generator
18-
github_changelog_generator -u scientific-python -p pydata --since-tag=<last tag>
17+
export VERSION=<version number>
18+
export PREVIOUS=<previous version number>
19+
export ORG="scientific-python"
20+
export REPO="devstats"
21+
22+
- Autogenerate release notes
23+
24+
changelist ${ORG}/${REPO} v${PREVIOUS} main --version ${VERSION}
25+
26+
- Put the output of the above command at the top of `CHANGELOG.md`
1927

2028
- Update `version` in `pyproject.toml`.
2129

2230
- Commit changes:
2331

2432
git add pyproject.toml CHANGELOG.md
25-
git commit -m 'Designate <version> release'
33+
git commit -m "Designate ${VERSION} release"
2634

27-
- Add the version number (e.g., `1.2.0`) as a tag in git:
35+
- Tag the release in git:
2836

29-
git tag -s [-u <key-id>] v<version> -m 'signed <version> tag'
37+
git tag -s v${VERSION} -m "signed ${VERSION} tag"
3038

3139
If you do not have a gpg key, use -u instead; it is important for
3240
Debian packaging that the tags are annotated
@@ -35,12 +43,12 @@ Example `version`
3543

3644
git push --tags origin main
3745

38-
where `origin` is the name of the `github.com:scientific-python/pydata
46+
where `origin` is the name of the `github.com:scientific-python/devstats`
3947
repository
4048

4149
- Review the github release page:
4250

43-
https://github.com/scientific-python/pydata/releases
51+
https://github.com/scientific-python/devstats/tags
4452

4553
- Publish on PyPi:
4654

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
### First responders
2+
3+
```{code-cell} ipython3
4+
---
5+
tags: [hide-input]
6+
---
7+
```
8+
9+
```{code-cell} ipython3
10+
---
11+
tags: [hide-input]
12+
---
13+
first_commenter_tab = pd.DataFrame(
14+
{
15+
k: v
16+
for k, v in zip(
17+
("Contributor", "# of times commented first"),
18+
np.unique(first_commenters, return_counts=True),
19+
)
20+
}
21+
)
22+
first_commenter_tab.sort_values(
23+
"# of times commented first", ascending=False
24+
).head(10)
25+
```
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
### New issues
2+
3+
%TODO: should probably use pandas for this
4+
5+
```{code-cell} ipython3
6+
---
7+
tags: [hide-input]
8+
---
9+
10+
newly_created = [
11+
iss for iss in issues if np.datetime64(iss["createdAt"]) > query_date
12+
]
13+
new_issues_closed = [iss for iss in newly_created if iss["state"] == "CLOSED"]
14+
15+
new_issue_lifetime = np.array(
16+
[
17+
np.datetime64(iss["closedAt"]) - np.datetime64(iss["createdAt"])
18+
for iss in new_issues_closed
19+
],
20+
).astype("m8[h]") # in hours
21+
22+
glue("{{ project }}_num_new_issues", len(newly_created))
23+
glue("{{ project }}_num_new_issues_closed", percent_val(len(new_issues_closed), len(newly_created)))
24+
glue("{{ project }}_new_issue_median_lifetime", f"{np.median(new_issue_lifetime)}")
25+
```
26+
27+
{glue:text}`{{ project }}_num_new_issues` new issues have been opened since
28+
{glue:text}`{{ project }}_query_date`, of which {glue:text}`{{ project }}_num_new_issues_closed` have been
29+
closed.
30+
31+
The median lifetime of new issues that were created and closed in this period
32+
is {glue:text}`{{ project }}_new_issue_median_lifetime`.
33+
34+
% TODO: replace with bokeh or some other live-plot
35+
% TODO: for any remaining static/mpl plots, set default params for things
36+
% like fontsize in a mplstyle file.
37+
38+
```{code-cell} ipython3
39+
---
40+
tags: [hide-input]
41+
---
42+
title = (
43+
f"Lifetime of issues created and closed in the last "
44+
f"{(np.datetime64(datetime.datetime.now()) - query_date).astype('m8[D]')}"
45+
)
46+
h, bedges = np.histogram(
47+
new_issue_lifetime.astype("m8[D]").astype(int), bins=np.arange(30)
48+
)
49+
50+
p = figure(
51+
width=670,
52+
height=400,
53+
title=title,
54+
tooltips=[("lifetime", "@right days"), (r"# issues", "@top")],
55+
)
56+
p.quad(top=h, bottom=0, left=bedges[:-1], right=bedges[1:])
57+
p.xaxis.axis_label = "Issue lifetime (days)"
58+
p.yaxis.axis_label = "# Issues"
59+
show(p)
60+
```

0 commit comments

Comments
 (0)