Skip to content

Commit eab1a3a

Browse files
authored
Add support for PI. (#10)
1 parent 5eda728 commit eab1a3a

12 files changed

Lines changed: 252 additions & 152 deletions

File tree

.github/workflows/ci.yml

Lines changed: 73 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
name: CI
2-
on: [push, pull_request]
2+
on:
3+
pull_request:
4+
push:
5+
branches: main
6+
defaults:
7+
run:
8+
shell: bash
9+
concurrency:
10+
group: CI-${{ github.ref }}
11+
# Queue on all branches and tags, but only cancel overlapping PR burns.
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' || !startsWith(github.ref, 'refs/tags/') }}
313
jobs:
414
org-check:
515
name: Check GitHub Organization
6-
if: ${{ github.repository_owner == 'jsirois' }}
7-
runs-on: ubuntu-22.04
16+
if: github.repository_owner == 'jsirois'
17+
runs-on: ubuntu-24.04
818
steps:
919
- name: Noop
1020
run: "true"
1121
checks:
1222
name: TOXENV=${{ matrix.tox-env }}
1323
needs: org-check
14-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
1525
strategy:
1626
matrix:
1727
include:
@@ -20,7 +30,7 @@ jobs:
2030
tox-env: lint
2131
- check-name: Types
2232
python-version: 3.9
23-
tox-env: typecheck
33+
tox-env: check
2434
steps:
2535
- name: Checkout
2636
uses: actions/checkout@v4
@@ -40,16 +50,40 @@ jobs:
4050
matrix:
4151
include:
4252
- python-version: [2, 7, 18]
43-
os: ubuntu-22.04
53+
os: ubuntu-24.04
4454
- python-version: [3, 5, 10]
45-
os: ubuntu-22.04
55+
os: ubuntu-24.04
4656
- python-version: [3, 6, 15]
47-
os: ubuntu-22.04
57+
os: ubuntu-24.04
58+
- python-version: [3, 7, 17]
59+
os: ubuntu-24.04
60+
- python-version: [3, 8, 18]
61+
os: ubuntu-24.04
4862
- python-version: [2, 7, 18]
49-
os: macos-12
63+
os: macos-13
5064
steps:
5165
- name: Checkout
5266
uses: actions/checkout@v4
67+
- name: Install Python Build Deps
68+
if: matrix.os == 'ubuntu-24.04'
69+
run: |
70+
sudo apt update &&
71+
sudo apt install -y \
72+
build-essential \
73+
libssl-dev \
74+
zlib1g-dev \
75+
libbz2-dev \
76+
libreadline-dev \
77+
libsqlite3-dev \
78+
curl \
79+
git \
80+
libncursesw5-dev \
81+
xz-utils \
82+
tk-dev \
83+
libxml2-dev \
84+
libxmlsec1-dev \
85+
libffi-dev \
86+
liblzma-dev
5387
- name: Setup Python ${{ join(matrix.python-version, '.') }}
5488
id: pyenv
5589
# Upgrade node16 -> node20: Out for review here:
@@ -61,7 +95,16 @@ jobs:
6195
run: |
6296
alias python="${{ steps.pyenv.outputs.pyenv_root }}/versions/${{ join(matrix.python-version, '.') }}/bin/python"
6397
python -V
64-
python -mensurepip -U
98+
99+
pyver="${{ matrix.python-version[0] }}.${{ matrix.python-version[1] }}"
100+
if [[ "3.8" == "${pyver}" ]]; then
101+
python -mensurepip
102+
else
103+
curl -fLO https://bootstrap.pypa.io/pip/${pyver}/get-pip.py
104+
python get-pip.py
105+
rm get-pip.py
106+
fi
107+
python -mpip install -U pip
65108
python -mpip install -U tox
66109
python -mtox -epy${{ matrix.python-version[0] }}${{ matrix.python-version[1] }} -- -vvs
67110
unit-tests:
@@ -71,33 +114,36 @@ jobs:
71114
strategy:
72115
matrix:
73116
include:
74-
- os: ubuntu-22.04
75-
python-version: [3, 7]
76-
- os: ubuntu-22.04
77-
python-version: [3, 8]
78-
- os: ubuntu-22.04
117+
- os: ubuntu-24.04
79118
python-version: [3, 9]
80-
- os: ubuntu-22.04
119+
- os: ubuntu-24.04
81120
python-version: [3, 10]
82-
- os: ubuntu-22.04
121+
- os: ubuntu-24.04
83122
python-version: [3, 11]
84-
- os: ubuntu-22.04
85-
python-version: [3, 12]
86-
- os: ubuntu-22.04
87-
python-version: [3, 13, "0-alpha.2"]
88-
- os: macos-12
123+
- os: ubuntu-24.04
89124
python-version: [3, 12]
90-
- os: macos-12
91-
python-version: [3, 13, "0-alpha.2"]
125+
- os: ubuntu-24.04
126+
python-version: [3, 13]
127+
- os: ubuntu-24.04
128+
python-version: [3, 14, "0-alpha.1"]
129+
- os: macos-13
130+
python-version: [3, 13]
131+
- os: macos-13
132+
python-version: [3, 14, "0-alpha.1"]
92133
steps:
93134
- name: Checkout
94135
uses: actions/checkout@v4
95136
- name: Setup Python ${{ join(matrix.python-version, '.') }}
96137
uses: actions/setup-python@v5
97138
with:
98139
python-version: "${{ join(matrix.python-version, '.') }}"
140+
- name: Setup Tox Python
141+
uses: actions/setup-python@v5
142+
with:
143+
python-version: 3.11
99144
- name: Run Unit Tests
100145
run: |
101-
pip install -U pip
102-
pip install -U tox
103-
tox -epy${{ matrix.python-version[0] }}${{ matrix.python-version[1] }} -- -vvs
146+
python3.11 -V
147+
python3.11 -mpip install -U pip
148+
python3.11 -mpip install -U tox
149+
python3.11 -mtox -epy${{ matrix.python-version[0] }}${{ matrix.python-version[1] }} -- -vvs

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ on:
1111
jobs:
1212
org_check:
1313
if: ${{ github.repository_owner == 'jsirois' }}
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- name: Noop
1717
run: "true"
1818
determine-tag:
1919
name: Determine the release tag to operate against.
2020
needs: org_check
21-
runs-on: ubuntu-22.04
21+
runs-on: ubuntu-24.04
2222
outputs:
2323
release-tag: ${{ steps.determine-tag.outputs.release-tag }}
2424
release-version: ${{ steps.determine-tag.outputs.release-version }}
@@ -41,7 +41,7 @@ jobs:
4141
pypi:
4242
name: Publish sdist and wheel to PyPI
4343
needs: [org_check, determine-tag]
44-
runs-on: ubuntu-22.04
44+
runs-on: ubuntu-24.04
4545
environment: Release
4646
permissions:
4747
id-token: write

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
/*.iml
33
/.idea/
44
/.tox/
5+
/build/
6+
/conscript.egg-info/
57
/dist/
68
__pycache__/

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include CHANGES.md
2+
graft tests
3+
global-exclude *.py[cod]

conscript/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
"""Conscript console scripts in your own Swiss Army Knife.
2-
3-
A Python BusyBox console script.
4-
""" # N.B.: Flit uses this as our distribution description.
5-
61
from __future__ import absolute_import
72

8-
__version__ = "0.1.7" # N.B.: Flit uses this as out distribution version.
3+
__version__ = "0.1.7" # N.B.: Setuptools is configured to use this as our distribution version.

conscript/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def main():
7070

7171
# Manual entrypoint execution with extra ergonomics:
7272
parser = argparse.ArgumentParser(
73+
prog=exe_name,
7374
description="A {exe_name} busy box.".format(exe_name=exe_name),
7475
formatter_class=RawTextHelpFormatter,
7576
add_help=False,

pyproject.toml

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
11
[build-system]
2-
requires = ["flit_core>=2,<4"]
3-
build-backend = "flit_core.buildapi"
4-
5-
[tool.flit.metadata]
6-
module = "conscript"
7-
author = "John Sirois"
8-
author-email = "john.sirois@gmail.com"
9-
home-page = "https://github.com/jsirois/conscript"
10-
description-file = "README.md"
11-
classifiers = [
12-
"Development Status :: 4 - Beta",
13-
"Intended Audience :: Developers",
14-
"License :: OSI Approved :: Apache Software License",
15-
"Programming Language :: Python",
16-
"Programming Language :: Python :: 2",
17-
"Programming Language :: Python :: 2.7",
18-
"Programming Language :: Python :: 3",
19-
"Programming Language :: Python :: 3.5",
20-
"Programming Language :: Python :: 3.6",
21-
"Programming Language :: Python :: 3.7",
22-
"Programming Language :: Python :: 3.8",
23-
"Programming Language :: Python :: 3.9",
24-
"Programming Language :: Python :: 3.10",
25-
"Programming Language :: Python :: 3.11",
26-
"Programming Language :: Python :: 3.12",
27-
"Programming Language :: Python :: 3.13",
28-
"Topic :: Utilities",
29-
]
30-
requires-python = ">=2.7,<3.14,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"
31-
requires = [
32-
"setuptools; python_version <= '3.5'",
33-
"importlib-metadata; python_version == '3.6' or python_version == '3.7'",
34-
]
35-
36-
[tool.flit.scripts]
37-
conscript = "conscript.main:main"
38-
39-
[tool.flit.sdist]
40-
include = ["CHANGES.md"]
41-
42-
[tool.flit.metadata.urls]
43-
Changelog = "https://github.com/jsirois/conscript/blob/main/CHANGES.md"
44-
Documentation = "https://github.com/jsirois/conscript/blob/main/README.md"
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
454

465
[tool.black]
476
line-length = 100

setup.cfg

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[metadata]
2+
name = conscript
3+
version = attr: conscript.__version__
4+
author = John Sirois
5+
author_email = john.sirois@gmail.com
6+
description = Conscript console scripts in your own Swiss Army Knife.
7+
long_description = file: README.md
8+
url = https://github.com/jsirois/conscript
9+
10+
project_urls =
11+
Changelog = https://github.com/jsirois/conscript/blob/main/CHANGES.md
12+
Documentation = https://github.com/jsirois/conscript/blob/main/README.md
13+
14+
classifiers =
15+
Development Status :: 4 - Beta
16+
Intended Audience :: Developers
17+
License :: OSI Approved :: Apache Software License
18+
Programming Language :: Python
19+
Programming Language :: Python :: 2
20+
Programming Language :: Python :: 2.7
21+
Programming Language :: Python :: 3
22+
Programming Language :: Python :: 3.5
23+
Programming Language :: Python :: 3.6
24+
Programming Language :: Python :: 3.7
25+
Programming Language :: Python :: 3.8
26+
Programming Language :: Python :: 3.9
27+
Programming Language :: Python :: 3.10
28+
Programming Language :: Python :: 3.11
29+
Programming Language :: Python :: 3.12
30+
Programming Language :: Python :: 3.13
31+
Programming Language :: Python :: 3.14
32+
Topic :: Utilities
33+
34+
[options]
35+
packages =
36+
conscript
37+
38+
python_requires = >=2.7,<3.15,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
39+
40+
install_requires =
41+
setuptools; python_version <= '3.5'
42+
importlib-metadata; python_version == '3.6' or python_version == '3.7'
43+
44+
[options.entry_points]
45+
console_scripts =
46+
conscript = conscript.main:main
47+

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup()

tests/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,20 @@ def create_conscript_zipapp(requirements):
5757
),
5858
"conscript.pyz",
5959
)
60-
args = [sys.executable, "-m", "shiv", project_root_dir]
60+
args = [
61+
sys.executable,
62+
"-m",
63+
"shiv",
64+
project_root_dir,
65+
"--python",
66+
"/usr/bin/env python3.{minor}".format(minor=sys.version_info[1]),
67+
]
6168
args.extend(requirements)
6269
args.extend(["-c", "conscript", "-o", pyz])
6370
subprocess.check_call(args)
6471
return pyz
6572

66-
if sys.version_info[:2] <= (3, 11):
73+
if sys.version_info[:2] <= (3, 12):
6774
return create_conscript_pex
6875
else:
6976
return create_conscript_zipapp

0 commit comments

Comments
 (0)