Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 44 additions & 62 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint autopep8
pip install autopep8

# Step 4: Run pylint on specified files
- name: Run pylint on specified files
id: pylint
run: |
pylint_output=$(pylint $(git ls-files '*.py' | grep -vE '(^tests/|^docs/)') --output-format=text) || true
echo "$pylint_output"
echo "::set-output name=pylint_output::$pylint_output"

# Step 5: Apply autopep8 fixes
- name: Apply autopep8 fixes
run: |
autopep8 --in-place --aggressive --aggressive $(git ls-files '*.py' | grep -vE '(^tests/|^docs/)')
Expand All @@ -56,57 +47,46 @@ jobs:
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
runs-on: windows-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Compile for Windows (32-bit & 64-bit)
run: |
clang -shared -m32 -o restructuredpython/lib/io32.dll restructuredpython/include/io.c
clang -shared -m64 -o restructuredpython/lib/io64.dll restructuredpython/include/io.c

- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-libs
path: restructuredpython/lib/io*.dll
- uses: actions/checkout@v4

- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install --upgrade pip cibuildwheel setuptools wheel toml

build-linux:
- name: Build wheels
run: python -m cibuildwheel
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Compile for Linux (.so)
run: |
gcc -shared -fPIC -o restructuredpython/lib/io.so restructuredpython/include/io.c
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux-libs
path: restructuredpython/lib/io.so
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Compile for macOS (.dylib)
run: |
clang -shared -fPIC -fdeclspec -o restructuredpython/lib/io.dylib restructuredpython/include/io.c

- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: macos-libs
path: restructuredpython/lib/io.dylib
publish:
runs-on: ubuntu-latest
needs: [build-windows, build-linux, build-macos]
needs: [build, build_sdist]
environment:
name: pypi
permissions:
Expand All @@ -115,10 +95,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Download all compiled libraries
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: restructuredpython/lib/
pattern: cibw-*
path: dist
merge-multiple: true

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -128,11 +110,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine setuptools wheel build toml

- name: Build the package with compiled shared libraries
pip install toml
- name: Extract version from pyproject.toml
id: extract_version
run: |
python3 -m build
python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])" > version.txt
echo "release_version=$(cat version.txt)" >> $GITHUB_ENV

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -144,8 +127,7 @@ jobs:
tag_name: "v${{ env.release_version }}"
name: "${{ env.release_version }}"
files: |
dist/*.whl
dist/*.tar.gz
dist/*
body: |
View the [changelog](https://restructuredpython.readthedocs.io/en/latest/changelog.html) for information about this release.
env:
Expand Down
113 changes: 43 additions & 70 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Create GitHub Release for PR
name: Build and Create Github Release for PR

on:
pull_request:
Expand All @@ -8,100 +8,73 @@ on:
- reopened
paths-ignore:
- 'docs/**'
- 'restructuredpython.egg-info/**'
- '.github/**'
- '.gitattributes'
- '.gitignore'
- 'README.md'

jobs:
Windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Compile Windows DLLs
run: |
clang -shared -m32 -o restructuredpython/lib/io32.dll restructuredpython/include/io.c
clang -shared -m64 -o restructuredpython/lib/io64.dll restructuredpython/include/io.c


- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-libs
path: restructuredpython/lib/io*.dll
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-latest]

Ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Compile Linux .so
run: |
gcc -shared -fPIC -o restructuredpython/lib/io.so restructuredpython/include/io.c
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux-libs
path: restructuredpython/lib/io.so
- uses: actions/setup-python@v5

macOS:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install cibuildwheel
run: python -m pip install --upgrade pip cibuildwheel setuptools wheel toml

- name: Compile macOS .dylib
run: |
clang -shared -fPIC -fdeclspec -o restructuredpython/lib/io.dylib restructuredpython/include/io.c
- name: Build wheels
uses: pypa/cibuildwheel@v3.0.0

- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: macos-libs
path: restructuredpython/lib/io.dylib

build-package:
runs-on: windows-latest
needs: [Windows, Ubuntu, macOS]
strategy:
matrix:
python-version: ["3.13"]
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
create_release:
runs-on: ubuntu-latest
needs: [build, build_sdist]
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download all compiled libraries
uses: actions/download-artifact@v4
with:
path: restructuredpython/lib/

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/download-artifact@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build

- name: Build the package
run: |
python -m build
pattern: cibw-*
path: dist
merge-multiple: true

- name: Create a GitHub release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: "#${{ github.event.pull_request.number }}"
name: "PR #${{ github.event.pull_request.number }}"
prerelease: true
files: |
dist/*.whl
dist/*.tar.gz
dist/*
body: |
Auto-generated wheels from PR #[${{github.event.pull_request.number}}](https://github.com/sharktide/restructuredpython/pull/${{github.event.pull_request.number}}).
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/*
*.pyc
build/*
build/*
wheelhouse/*
restructuredpython.egg-info/**
48 changes: 0 additions & 48 deletions compile.bat

This file was deleted.

9 changes: 8 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
reStructuredPython Changelog
Changelog
=============================

*Note: This changelog skips version 0.1.1*
Expand All @@ -8,6 +8,13 @@ Major release 2

.. raw:: html

<details>
<summary>2.5.0</summary>
<ul>
<li>Introduced &lt;OPTIMIZE&gt; markers, which allow restructuredpython code to be executed faster than cpython would normally when restructuredpython is installed.
</ul>
</details>

<details>
<summary>2.4.0</summary>
<ul>
Expand Down
Loading