Skip to content

Commit 08fe89e

Browse files
committed
Initial commit after norwegianblue fork
1 parent 09c121d commit 08fe89e

29 files changed

+224
-1386
lines changed

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ exclude_lines =
1212

1313
[run]
1414
omit =
15-
src/norwegianblue/__main__.py
16-
src/norwegianblue/cli.py
15+
*/pepotron/__main__.py
16+
*/pepotron/cli.py

.github/workflows/deploy.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,19 @@ on:
1212
jobs:
1313
deploy:
1414
if: github.repository_owner == 'hugovk'
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 0
2121

22-
- name: Cache
23-
uses: actions/cache@v2
24-
with:
25-
path: ~/.cache/pip
26-
key: deploy-${{ hashFiles('**/setup.py') }}
27-
restore-keys: |
28-
deploy-
29-
3022
- name: Set up Python
31-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v3
3224
with:
3325
python-version: "3.10"
26+
cache: pip
27+
cache-dependency-path: "setup.py"
3428

3529
- name: Install dependencies
3630
run: |

.github/workflows/labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
sync:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- uses: micnncim/action-label-syncer@v1
1717
with:
1818
prune: false

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-python@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-python@v3
1212
- uses: pre-commit/[email protected]

.github/workflows/release-drafter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ on:
55
# branches to consider in the event; optional, defaults to all
66
branches:
77
- main
8+
workflow_dispatch:
89

910
jobs:
1011
update_release_draft:
11-
if: github.repository == 'hugovk/norwegianblue'
12+
if: github.repository_owner == 'hugovk'
1213
runs-on: ubuntu-latest
1314
steps:
1415
# Drafts your next release notes as pull requests are merged into "main"

.github/workflows/test.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ["pypy-3.7", "3.7", "3.8", "3.9", "3.10"]
14+
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
include:
1717
# Include new variables for Codecov
@@ -20,27 +20,14 @@ jobs:
2020
- { codecov-flag: GHA_Windows, os: windows-latest }
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424

2525
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
26+
uses: actions/setup-python@v3
2727
with:
2828
python-version: ${{ matrix.python-version }}
29-
30-
- name: Get pip cache dir
31-
id: pip-cache
32-
run: |
33-
echo "::set-output name=dir::$(pip cache dir)"
34-
35-
- name: Cache
36-
uses: actions/cache@v2
37-
with:
38-
path: ${{ steps.pip-cache.outputs.dir }}
39-
key:
40-
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{
41-
hashFiles('**/setup.py') }}
42-
restore-keys: |
43-
${{ matrix.os }}-${{ matrix.python-version }}-v1-
29+
cache: pip
30+
cache-dependency-path: "setup.py"
4431

4532
- name: Install dependencies
4633
run: |
@@ -52,12 +39,6 @@ jobs:
5239
run: |
5340
tox -e py
5441
55-
- name: Tox tests (pins)
56-
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
57-
shell: bash
58-
run: |
59-
tox -e pins
60-
6142
- name: Upload coverage
6243
uses: codecov/[email protected]
6344
with:

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,3 @@ venv.bak/
110110
.mypy_cache/
111111
.dmypy.json
112112
dmypy.json
113-
114-
# Version number generated by setuptools_scm
115-
_version.py

.pre-commit-config.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.31.0
3+
rev: v2.31.1
44
hooks:
55
- id: pyupgrade
66
args: [--py37-plus]
77

88
- repo: https://github.com/psf/black
9-
rev: 21.12b0
9+
rev: 22.1.0
1010
hooks:
1111
- id: black
1212
args: [--target-version=py37]
@@ -39,9 +39,15 @@ repos:
3939
rev: v1.20.0
4040
hooks:
4141
- id: setup-cfg-fmt
42+
args: [--max-py-version=3.11]
43+
44+
- repo: https://github.com/tox-dev/tox-ini-fmt
45+
rev: "0.5.2"
46+
hooks:
47+
- id: tox-ini-fmt
4248

4349
- repo: https://github.com/pre-commit/mirrors-prettier
44-
rev: v2.5.1
50+
rev: v2.6.0
4551
hooks:
4652
- id: prettier
4753
args: [--prose-wrap=always, --print-width=88]

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018-2021 Hugo van Kemenade
3+
Copyright (c) 2018-2022 Hugo van Kemenade
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 28 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,186 +1,67 @@
1-
# norwegianblue
2-
3-
[![PyPI version](https://img.shields.io/pypi/v/norwegianblue.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/norwegianblue/)
4-
[![Supported Python versions](https://img.shields.io/pypi/pyversions/norwegianblue.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/norwegianblue/)
5-
[![PyPI downloads](https://img.shields.io/pypi/dm/norwegianblue.svg)](https://pypistats.org/packages/norwegianblue)
6-
[![Test](https://github.com/hugovk/norwegianblue/actions/workflows/test.yml/badge.svg)](https://github.com/hugovk/norwegianblue/actions)
7-
[![codecov](https://codecov.io/gh/hugovk/norwegianblue/branch/main/graph/badge.svg)](https://codecov.io/gh/hugovk/norwegianblue)
8-
[![GitHub](https://img.shields.io/github/license/hugovk/norwegianblue.svg)](LICENSE.txt)
1+
# pepotron
2+
3+
[![PyPI version](https://img.shields.io/pypi/v/pepotron.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/pepotron/)
4+
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pepotron.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/pepotron/)
5+
[![PyPI downloads](https://img.shields.io/pypi/dm/pepotron.svg)](https://pypistats.org/packages/pepotron)
6+
[![Test](https://github.com/hugovk/pepotron/actions/workflows/test.yml/badge.svg)](https://github.com/hugovk/pepotron/actions)
7+
[![codecov](https://codecov.io/gh/hugovk/pepotron/branch/main/graph/badge.svg)](https://codecov.io/gh/hugovk/pepotron)
8+
[![GitHub](https://img.shields.io/github/license/hugovk/pepotron.svg)](LICENSE.txt)
99
[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)
1010

11-
<p align="center"><img src="https://raw.githubusercontent.com/hugovk/norwegianblue/main/img/eol-python.png" width="319" height="197"></p>
12-
13-
Python interface to [endoflife.date](https://endoflife.date/docs/api/) to show
14-
end-of-life dates for a number of products.
11+
CLI to open PEPs in your browser.
1512

1613
## Installation
1714

1815
### From PyPI
1916

2017
```bash
21-
python -m pip install --upgrade norwegianblue
18+
python3 -m pip install --upgrade pepotron
2219
```
2320

2421
### From source
2522

2623
```bash
27-
git clone https://github.com/hugovk/norwegianblue
28-
cd norwegianblue
24+
git clone https://github.com/hugovk/pepotron
25+
cd pepotron
2926
pip install .
3027
```
3128

32-
## Example command-line use
33-
34-
Run `norwegianblue` or `eol`, they do the same thing.
29+
## Usage
3530

36-
Top-level help:
31+
### Help
3732

3833
<!-- [[[cog
3934
from scripts.run_command import run
40-
run("eol --help")
35+
run("pep --help")
4136
]]] -->
4237

4338
```console
44-
$ eol --help
45-
usage: eol [-h] [-f {html,json,markdown,rst,tsv}] [-c {yes,no,auto}]
46-
[--clear-cache] [-v] [-V]
47-
[product]
48-
49-
CLI to show end-of-life dates for a number of products, from https://endoflife.date
39+
$ pep --help
40+
usage: pep [-h] [-u URL] [-V] search
5041

51-
For example:
52-
53-
* `eol python` to see Python EOLs
54-
* `eol ubuntu` to see Ubuntu EOLs
55-
* `eol all` to list all available products
56-
57-
Something missing? Please contribute! https://endoflife.date/contribute
42+
CLI to open PEPs in your browser
5843

5944
positional arguments:
60-
product Product to check, or 'all' to list all available
61-
(default: all)
45+
search PEP number, or Python version for its schedule
6246

6347
options:
64-
-h, --help show this help message and exit
65-
-f {html,json,markdown,rst,tsv}, --format {html,json,markdown,rst,tsv}
66-
The format of output (default: markdown)
67-
-c {yes,no,auto}, --color {yes,no,auto}
68-
color terminal output (default: auto)
69-
--clear-cache Clear cache before running (default: False)
70-
-v, --verbose Print debug messages to stderr (default: False)
71-
-V, --version show program's version number and exit
48+
-h, --help show this help message and exit
49+
-u URL, --url URL Base URL for PEPs (default: https://peps.python.org)
50+
-V, --version show program's version number and exit
7251
```
7352

7453
<!-- [[[end]]] -->
7554

76-
List all available products with end-of-life dates:
55+
### Open a PEP
7756

7857
```console
79-
$ # eol all
80-
$ # or:
58+
$ pep 8
59+
https://peps.python.org/pep-0008/
8160
```
8261

83-
<!-- [[[cog
84-
from scripts.run_command import run
85-
run("eol", line_limit=5)
86-
]]] -->
62+
### Open release schedule PEP for a Python version
8763

8864
```console
89-
$ eol
90-
alpine
91-
amazon-eks
92-
amazon-linux
93-
android
94-
angular
95-
...
65+
$ pep 3.11
66+
https://peps.python.org/pep-0664/
9667
```
97-
98-
<!-- [[[end]]] -->
99-
100-
Show end-of-life dates:
101-
102-
<!-- [[[cog
103-
from scripts.run_command import run
104-
run("norwegianblue python")
105-
]]] -->
106-
107-
```console
108-
$ norwegianblue python
109-
| cycle | latest | release | eol |
110-
|:------|:-------|:----------:|:----------:|
111-
| 3.10 | 3.10.0 | 2021-10-04 | 2026-10-04 |
112-
| 3.9 | 3.9.9 | 2020-10-05 | 2025-10-05 |
113-
| 3.8 | 3.8.12 | 2019-10-14 | 2024-10-14 |
114-
| 3.7 | 3.7.12 | 2018-06-27 | 2023-06-27 |
115-
| 3.6 | 3.6.15 | 2016-12-23 | 2021-12-23 |
116-
| 3.5 | 3.5.10 | 2015-09-30 | 2020-09-13 |
117-
| 3.4 | 3.4.10 | 2014-03-16 | 2019-03-18 |
118-
| 3.3 | 3.3.7 | 2012-09-29 | 2017-09-29 |
119-
| 2.7 | 2.7.18 | 2010-07-03 | 2020-01-01 |
120-
```
121-
122-
<!-- [[[end]]] -->
123-
124-
The table is Markdown, ready for pasting in GitHub issues and PRs:
125-
126-
<!-- [[[cog
127-
from scripts.run_command import run
128-
run("norwegianblue python", with_console=False)
129-
]]] -->
130-
131-
| cycle | latest | release | eol |
132-
| :---- | :----- | :--------: | :--------: |
133-
| 3.10 | 3.10.0 | 2021-10-04 | 2026-10-04 |
134-
| 3.9 | 3.9.9 | 2020-10-05 | 2025-10-05 |
135-
| 3.8 | 3.8.12 | 2019-10-14 | 2024-10-14 |
136-
| 3.7 | 3.7.12 | 2018-06-27 | 2023-06-27 |
137-
| 3.6 | 3.6.15 | 2016-12-23 | 2021-12-23 |
138-
| 3.5 | 3.5.10 | 2015-09-30 | 2020-09-13 |
139-
| 3.4 | 3.4.10 | 2014-03-16 | 2019-03-18 |
140-
| 3.3 | 3.3.7 | 2012-09-29 | 2017-09-29 |
141-
| 2.7 | 2.7.18 | 2010-07-03 | 2020-01-01 |
142-
143-
<!-- [[[end]]] -->
144-
145-
With options:
146-
147-
<!-- [[[cog
148-
from scripts.run_command import run
149-
run("eol nodejs --format rst")
150-
]]] -->
151-
152-
```console
153-
$ eol nodejs --format rst
154-
.. table::
155-
156-
======== ========= ============ ============ ============
157-
cycle latest release support eol
158-
======== ========= ============ ============ ============
159-
17 17.1.0 2021-10-19 2022-04-01 2022-06-01
160-
16 LTS 16.13.0 2021-04-20 2022-10-18 2024-04-30
161-
15 15.14.0 2020-10-20 2021-04-01 2021-06-01
162-
14 LTS 14.18.1 2020-04-21 2021-10-19 2023-04-30
163-
12 LTS 12.22.7 2019-04-23 2020-10-20 2022-04-30
164-
10 LTS 10.24.1 2018-04-24 2020-05-19 2021-04-30
165-
======== ========= ============ ============ ============
166-
```
167-
168-
<!-- [[[end]]] -->
169-
170-
## Example programmatic use
171-
172-
Return values are from the JSON responses documented in the API:
173-
https://endoflife.date/docs/api/
174-
175-
```python
176-
import norwegianblue
177-
178-
# Call the API
179-
print(norwegianblue.norwegianblue())
180-
print(norwegianblue.norwegianblue(product="ubuntu"))
181-
print(norwegianblue.norwegianblue(format="json"))
182-
```
183-
184-
## Why "Norwegian Blue"?
185-
186-
[The Norwegian Blue has reached end-of-life.](https://youtu.be/vnciwwsvNcc)

0 commit comments

Comments
 (0)