Skip to content
Open
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
52 changes: 47 additions & 5 deletions .github/workflows/build-glibc236.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ jobs:
curl \
llvm \
make \
xz-utils
xz-utils \
dpkg-deb \
fakeroot

- name: Download Python source
run: |
Expand Down Expand Up @@ -141,10 +143,45 @@ jobs:
cd ..

echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV

- name: Create deb package
run: |
PACKAGE_NAME="python-${{ github.event.inputs.python_version }}-linux-glibc236-$(uname -m)"
PY_VERSION="${{ github.event.inputs.python_version }}"
PY_MAJOR_MINOR=$(echo $PY_VERSION | cut -d. -f1,2)

# Create deb package structure
mkdir -p deb_package/DEBIAN
mkdir -p deb_package/opt/python-$PY_VERSION-glibc236

# Copy Python installation to deb package structure
cp -r python_install/* deb_package/opt/python-$PY_VERSION-glibc236/

# Create DEBIAN control file
INSTALLED_SIZE=$(du -sk deb_package/opt | cut -f1)
echo "Package: python${PY_MAJOR_MINOR}-custom-glibc236" > deb_package/DEBIAN/control
echo "Version: $PY_VERSION" >> deb_package/DEBIAN/control
echo "Section: interpreters" >> deb_package/DEBIAN/control
echo "Priority: optional" >> deb_package/DEBIAN/control
echo "Architecture: amd64" >> deb_package/DEBIAN/control
echo "Installed-Size: $INSTALLED_SIZE" >> deb_package/DEBIAN/control
echo "Depends: libc6 (>= 2.17), libssl3 | libssl1.1 | libssl1.0.0, zlib1g, libbz2-1.0, libffi8 | libffi7 | libffi6, libgdbm6 | libgdbm5 | libgdbm3, liblzma5, libncurses6 | libncurses5, libreadline8 | libreadline7 | libreadline6, libsqlite3-0, uuid-runtime" >> deb_package/DEBIAN/control
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This long dependency line is difficult to read and maintain. Consider breaking it into multiple echo statements or using a multi-line approach for better readability.

Suggested change
echo "Depends: libc6 (>= 2.17), libssl3 | libssl1.1 | libssl1.0.0, zlib1g, libbz2-1.0, libffi8 | libffi7 | libffi6, libgdbm6 | libgdbm5 | libgdbm3, liblzma5, libncurses6 | libncurses5, libreadline8 | libreadline7 | libreadline6, libsqlite3-0, uuid-runtime" >> deb_package/DEBIAN/control
DEPENDS="libc6 (>= 2.17),"
DEPENDS="$DEPENDS libssl3 | libssl1.1 | libssl1.0.0,"
DEPENDS="$DEPENDS zlib1g,"
DEPENDS="$DEPENDS libbz2-1.0,"
DEPENDS="$DEPENDS libffi8 | libffi7 | libffi6,"
DEPENDS="$DEPENDS libgdbm6 | libgdbm5 | libgdbm3,"
DEPENDS="$DEPENDS liblzma5,"
DEPENDS="$DEPENDS libncurses6 | libncurses5,"
DEPENDS="$DEPENDS libreadline8 | libreadline7 | libreadline6,"
DEPENDS="$DEPENDS libsqlite3-0,"
DEPENDS="$DEPENDS uuid-runtime"
echo "Depends: $DEPENDS" >> deb_package/DEBIAN/control

Copilot uses AI. Check for mistakes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary dependencies just keep important ones

echo "Maintainer: anubhavkrishna1 <noreply@github.com>" >> deb_package/DEBIAN/control
echo "Description: Custom Python $PY_VERSION interpreter (glibc 2.36 compatible)" >> deb_package/DEBIAN/control
echo " This package provides a custom-built Python $PY_VERSION interpreter" >> deb_package/DEBIAN/control
echo " with optimizations enabled and built for glibc 2.36 compatibility." >> deb_package/DEBIAN/control
echo " Built from source with LTO and PGO optimizations for better performance" >> deb_package/DEBIAN/control
echo " while maintaining compatibility with older Linux distributions." >> deb_package/DEBIAN/control
echo " ." >> deb_package/DEBIAN/control
echo " The Python installation is located in /opt/python-$PY_VERSION-glibc236/" >> deb_package/DEBIAN/control
echo " and includes pip, setuptools, and wheel." >> deb_package/DEBIAN/control

# Build deb package
fakeroot dpkg-deb --build deb_package $PACKAGE_NAME.deb

- name: Create checksum file
run: |
sha256sum ${{ env.PACKAGE_NAME }}.tar.gz ${{ env.PACKAGE_NAME }}.zip > SHA256SUMS.txt
sha256sum ${{ env.PACKAGE_NAME }}.tar.gz ${{ env.PACKAGE_NAME }}.zip ${{ env.PACKAGE_NAME }}.deb > SHA256SUMS.txt

- name: Create Release
id: create_release
Expand Down Expand Up @@ -172,16 +209,21 @@ jobs:
- SQLite extensions support
- Optimized with LTO and PGO

**Available Formats:**
- `.tar.gz` - Extract to any directory
- `.zip` - Extract to any directory
- `.deb` - Debian/Ubuntu package (installs to /opt/python-${{ github.event.inputs.python_version }}-glibc236/)

**Installation:**
1. Download the tar.gz file
2. Download and run the install.sh script: `bash install.sh [install_path]`
3. Or extract manually: `tar -xzf ${{ env.PACKAGE_NAME }}.tar.gz -C /your/install/path`
- **Debian/Ubuntu**: `sudo dpkg -i ${{ env.PACKAGE_NAME }}.deb`
- **Manual**: Extract tar.gz or zip to desired location

draft: false
prerelease: false
files: |
${{ env.PACKAGE_NAME }}.tar.gz
${{ env.PACKAGE_NAME }}.zip
${{ env.PACKAGE_NAME }}.deb
SHA256SUMS.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
48 changes: 46 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Cache apt packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: build-essential gdb lcov pkg-config libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev wget curl llvm make
packages: build-essential gdb lcov pkg-config libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev wget curl llvm make dpkg-deb fakeroot
version: 1.0

- name: Download Python source
Expand Down Expand Up @@ -78,10 +78,44 @@ jobs:
cd ..

echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV

- name: Create deb package
run: |
PACKAGE_NAME="python-${{ github.event.inputs.python_version }}-linux-$(uname -m)"
PY_VERSION="${{ github.event.inputs.python_version }}"
PY_MAJOR_MINOR=$(echo $PY_VERSION | cut -d. -f1,2)

# Create deb package structure
mkdir -p deb_package/DEBIAN
mkdir -p deb_package/opt/python-$PY_VERSION

# Copy Python installation to deb package structure
cp -r python_install/* deb_package/opt/python-$PY_VERSION/

# Create DEBIAN control file
INSTALLED_SIZE=$(du -sk deb_package/opt | cut -f1)
echo "Package: python${PY_MAJOR_MINOR}-custom" > deb_package/DEBIAN/control
echo "Version: $PY_VERSION" >> deb_package/DEBIAN/control
echo "Section: interpreters" >> deb_package/DEBIAN/control
echo "Priority: optional" >> deb_package/DEBIAN/control
echo "Architecture: amd64" >> deb_package/DEBIAN/control
echo "Installed-Size: $INSTALLED_SIZE" >> deb_package/DEBIAN/control
echo "Depends: libc6 (>= 2.17), libssl3 | libssl1.1, zlib1g, libbz2-1.0, libffi8 | libffi7 | libffi6, libgdbm6 | libgdbm5, liblzma5, libncurses6 | libncurses5, libreadline8 | libreadline7 | libreadline6, libsqlite3-0, uuid-runtime" >> deb_package/DEBIAN/control
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This long dependency line is difficult to read and maintain. Consider breaking it into multiple echo statements or using a multi-line approach for better readability.

Copilot uses AI. Check for mistakes.

echo "Maintainer: anubhavkrishna1 <noreply@github.com>" >> deb_package/DEBIAN/control
echo "Description: Custom Python $PY_VERSION interpreter" >> deb_package/DEBIAN/control
echo " This package provides a custom-built Python $PY_VERSION interpreter" >> deb_package/DEBIAN/control
echo " with optimizations enabled. Built from source with LTO and PGO" >> deb_package/DEBIAN/control
echo " optimizations for better performance." >> deb_package/DEBIAN/control
echo " ." >> deb_package/DEBIAN/control
echo " The Python installation is located in /opt/python-$PY_VERSION/" >> deb_package/DEBIAN/control
echo " and includes pip, setuptools, and wheel." >> deb_package/DEBIAN/control

# Build deb package
fakeroot dpkg-deb --build deb_package $PACKAGE_NAME.deb

- name: Create checksum file
run: |
sha256sum ${{ env.PACKAGE_NAME }}.tar.gz ${{ env.PACKAGE_NAME }}.zip > SHA256SUMS.txt
sha256sum ${{ env.PACKAGE_NAME }}.tar.gz ${{ env.PACKAGE_NAME }}.zip ${{ env.PACKAGE_NAME }}.deb > SHA256SUMS.txt

- name: Create Release
id: create_release
Expand All @@ -100,11 +134,21 @@ jobs:
- Build Date: ${{ env.BUILD_DATE }}
- Built by: anubhavkrishna1

**Available Formats:**
- `.tar.gz` - Extract to any directory
- `.zip` - Extract to any directory
- `.deb` - Debian/Ubuntu package (installs to /opt/python-${{ github.event.inputs.python_version }}/)

**Installation:**
- **Debian/Ubuntu**: `sudo dpkg -i ${{ env.PACKAGE_NAME }}.deb`
- **Manual**: Extract tar.gz or zip to desired location

draft: false
prerelease: false
files: |
${{ env.PACKAGE_NAME }}.tar.gz
${{ env.PACKAGE_NAME }}.zip
${{ env.PACKAGE_NAME }}.deb
SHA256SUMS.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,28 @@ This repository provides pre-built Python binaries for Linux. Follow the steps b
1. **📥 Download the Binary**

- Navigate to the [Releases](https://github.com/anubhavkrishna1/python3-binary/releases) section of this repository.
- Download the appropriate binary archive (`.tar.gz` or `.zip`) for your desired Python version and architecture.
- Download the appropriate binary archive for your desired Python version and architecture:
- `.tar.gz` or `.zip` files for manual extraction
- `.deb` files for Debian/Ubuntu systems

2. **📦 Extract the Binary**
2. **📦 Install the Binary**

**For Debian/Ubuntu systems (recommended):**
```bash
# Download the .deb file and install
sudo dpkg -i python-<version>-linux-<arch>.deb

# Python will be installed to /opt/python-<version>/bin/
# You can use it directly:
/opt/python-<version>/bin/python3 --version
/opt/python-<version>/bin/pip3 --version

# Or add to your PATH for convenience:
export PATH="/opt/python-<version>/bin:$PATH"
python3 --version
```

**For manual installation:**
- For `.tar.gz` files:

```bash
Expand All @@ -31,7 +50,7 @@ This repository provides pre-built Python binaries for Linux. Follow the steps b
unzip python-<version>-linux-<arch>.zip -d /desired/path
```

3. **🔧 Set Up Environment**
3. **🔧 Set Up Environment (Manual Installation Only)**

- Add the extracted binary directory to your `PATH`:

Expand All @@ -45,7 +64,23 @@ This repository provides pre-built Python binaries for Linux. Follow the steps b
```

4. **💻 Start Using Python**
- You can now use the custom Python binary for your projects.
- **Debian/Ubuntu users**: Python is installed to `/opt/python-<version>/` and can be used directly or added to PATH
- **Manual installation users**: You can now use the custom Python binary for your projects.

## 🗑️ Uninstalling (Debian/Ubuntu)

To remove a Python version installed via deb package:

```bash
# List installed custom Python packages
dpkg -l | grep python.*custom

# Remove the package (replace with your specific version)
sudo dpkg -r python3.11-custom

# For glibc236 versions
sudo dpkg -r python3.11-custom-glibc236
```

## 🛠️ Building Your Own Custom Python Version

Expand Down