Skip to content

Commit

Permalink
Update to Python 3.12. (#53)
Browse files Browse the repository at this point in the history
This also updates all dependencies and fixes the minor fallout of four
MyPy typecheck issues (all instances of no support yet for
@dataclass_transform: python/mypy#14293) and
one Sphinx issue with the custom directive system's use of markdown.
  • Loading branch information
jsirois authored Oct 3, 2023
1 parent 79bb1cb commit 653fbf8
Show file tree
Hide file tree
Showing 21 changed files with 644 additions and 657 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
resource_class: arm.medium
steps:
- run:
name: Install Python 3.11
name: Install Python 3.12
command: |
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.11-dev python3.11-venv python3.11-distutils
sudo apt install -y python3.12-dev python3.12-venv python3.12-distutils
- run:
name: Setup Nox
command: |
python3.11 -m venv ~/bin/nox.venv
python3.12 -m venv ~/bin/nox.venv
~/bin/nox.venv/bin/pip install nox
cd ~/bin
ln -s nox.venv/bin/nox
Expand All @@ -60,15 +60,15 @@ jobs:
resource_class: arm.medium
steps:
- run:
name: Install Python 3.11
name: Install Python 3.12
command: |
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.11-dev python3.11-venv python3.11-distutils
sudo apt install -y python3.12-dev python3.12-venv python3.12-distutils
- run:
name: Setup Nox
command: |
python3.11 -m venv ~/bin/nox.venv
python3.12 -m venv ~/bin/nox.venv
~/bin/nox.venv/bin/pip install nox
cd ~/bin
ln -s nox.venv/bin/nox
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
env:
SCIENCE_AUTH_API_GITHUB_COM_BEARER: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@v4
if: matrix.os != 'macos-13-aarch64'
with:
python-version: 3.11
python-version: 3.12
- name: Setup Nox
run: pip install nox
- name: Checkout Lift
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12
- name: Setup Nox
run: pip install nox
- name: Checkout Lift
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
env:
SCIENCE_AUTH_API_GITHUB_COM_BEARER: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@v4
if: matrix.os != 'macos-13-aarch64'
with:
python-version: 3.11
python-version: 3.12
- name: Setup Nox
run: pip install nox
- name: Checkout lift ${{ needs.determine-tag.outputs.release-tag }}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Thank you in advance for your time and effort.
## Development Environment

You'll need just a few tools to hack on the scie-jump:
+ A Python 3.11 interpreter
+ A Python 3.12 interpreter
+ The [`nox`](https://nox.thea.codes/en/stable/) tool.

## Development Cycle
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ your $PATH somewhere.
The binaries are released via [GitHub Releases](https://github.com/a-scie/lift/releases)
for Windows x86_64 and Linux and macOS for both aarch64 and x86_64. For each of these platforms
there are two varieties, "thin" and "fat". The "fat" varieties are named `science-fat-*`, include
a hermetic CPython 3.11 distribution from the [Python Build Standalone]() project and are larger as
a result. The "thin" varieties have the CPython 3.11 distribution gouged out and are smaller as a
a hermetic CPython 3.12 distribution from the [Python Build Standalone]() project and are larger as
a result. The "thin" varieties have the CPython 3.12 distribution gouged out and are smaller as a
result. In its place a [`ptex`](https://github.com/a-scie/ptex) binary is included that fills in the
CPython 3.11 distribution by fetching it when the "thin" `science` binary is first run.
CPython 3.12 distribution by fetching it when the "thin" `science` binary is first run.

I run on Linux x86_64; so I install a stable release like so:
```
Expand All @@ -45,4 +45,4 @@ build instructions there.
## Contribute

See the [contribution guide](CONTRIBUTING.md) if you're interested in hacking on `science` or
improving its documentation.
improving its documentation.
44 changes: 26 additions & 18 deletions complete-platform.windows-amd64-py3.11.json → complete-platform.windows-amd64-py3.12.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
{
"marker_environment": {
"implementation_name": "cpython",
"implementation_version": "3.11.0",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_python_implementation": "CPython",
"platform_release": "10",
"platform_system": "Windows",
"platform_version": "10.0.22621",
"python_full_version": "3.11.0",
"python_version": "3.11",
"sys_platform": "win32"
},
"path": "C:\\Program Files\\Python312\\python.exe",
"version": "3.12.0",
"requirement": "CPython==3.12.0",
"platform": "win_amd64-cp-3.12.0-cp312",
"venv": false,
"compatible_tags": [
"cp311-cp311-win_amd64",
"cp312-cp312-win_amd64",
"cp312-abi3-win_amd64",
"cp312-none-win_amd64",
"cp311-abi3-win_amd64",
"cp311-none-win_amd64",
"cp310-abi3-win_amd64",
"cp39-abi3-win_amd64",
"cp38-abi3-win_amd64",
Expand All @@ -25,8 +18,9 @@
"cp34-abi3-win_amd64",
"cp33-abi3-win_amd64",
"cp32-abi3-win_amd64",
"py311-none-win_amd64",
"py312-none-win_amd64",
"py3-none-win_amd64",
"py311-none-win_amd64",
"py310-none-win_amd64",
"py39-none-win_amd64",
"py38-none-win_amd64",
Expand All @@ -38,8 +32,9 @@
"py32-none-win_amd64",
"py31-none-win_amd64",
"py30-none-win_amd64",
"py311-none-any",
"py312-none-any",
"py3-none-any",
"py311-none-any",
"py310-none-any",
"py39-none-any",
"py38-none-any",
Expand All @@ -51,5 +46,18 @@
"py32-none-any",
"py31-none-any",
"py30-none-any"
]
],
"marker_environment": {
"implementation_name": "cpython",
"implementation_version": "3.12.0",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_python_implementation": "CPython",
"platform_release": "11",
"platform_system": "Windows",
"platform_version": "10.0.22621",
"python_full_version": "3.12.0",
"python_version": "3.12",
"sys_platform": "win32"
}
}
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@
"sphinx_click",
]

# N.B.: Order is critical here for Sphinx to find our custom directive generated content, which
# resides in `.md` files.
# See: https://www.sphinx-doc.org/en/master/_modules/sphinx/project.html#Project.doc2path
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
".rst": "restructuredtext",
}

templates_path = [
Expand Down
10 changes: 5 additions & 5 deletions lift.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ description = "Ship your interpreted executables using science."
[[lift.interpreters]]
id = "cpython"
provider = "PythonBuildStandalone"
release = "20230826"
version = "3.11.5"
# By default science ships as a "thin" scie that fetches CPython 3.11 on first run.
release = "20231002"
version = "3.12.0"
# By default science ships as a "thin" scie that fetches CPython 3.12 on first run.
# We use `science lift --invert-lazy cpython ...` when producing "fat" scies.
lazy = true

Expand All @@ -24,7 +24,7 @@ name = "docsite"
name = "science.pyz"

[[lift.commands]]
# This selects the `python` binary from within the CPython 3.11 interpreter distribution
# This selects the `python` binary from within the CPython 3.12 interpreter distribution
# (a tarball) provided by PythonBuildStandalone above.
exe = "#{cpython:python}"
args = [
Expand All @@ -33,7 +33,7 @@ args = [

[lift.commands.env]
# We strip any ambient SHIV_* env vars and set the SHIV_ROOT to ensure hermetic operation. Although
# `science` is a Python 3.11 shiv zipapp application under the covers; this should be opaque to the
# `science` is a Python 3.12 shiv zipapp application under the covers; this should be opaque to the
# end user. For their puposes `science` is just a native binary.
remove_re = [
"SHIV_.*",
Expand Down
Loading

0 comments on commit 653fbf8

Please sign in to comment.