Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 32bit support #25

Merged
merged 15 commits into from
Jun 28, 2024
10 changes: 10 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ jobs:
target: aarch64-unknown-linux-musl,
os: ubuntu-latest,
}
- {
name: "Linux-x86",
target: i686-unknown-linux-musl,
os: ubuntu-latest,
}
- {
name: "macOS-x86_64",
target: x86_64-apple-darwin,
Expand All @@ -79,6 +84,11 @@ jobs:
target: x86_64-pc-windows-msvc,
os: windows-latest,
}
- {
name: "windows-x86",
target: i686-pc-windows-msvc,
os: windows-latest,
}
env:
#
# These are some environment variables that configure the build so that the binary size is reduced.
Expand Down
56 changes: 49 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,55 @@ jobs:
strategy:
matrix:
include:
- { python-version: "3.8", tox-env: "py38", os: "ubuntu-latest" }
- { python-version: "3.9", tox-env: "py39", os: "ubuntu-latest" }
- { python-version: "3.10", tox-env: "py310", os: "ubuntu-latest" }
- { python-version: "3.11", tox-env: "py311", os: "ubuntu-latest" }
- { python-version: "3.12", tox-env: "py312", os: "ubuntu-latest" }
- { python-version: "3.12", tox-env: "py312", os: "windows-latest" }
name: Python ${{ matrix.python-version }} tests (${{ matrix.os }})
- {
python-version: "3.8",
tox-env: "py38",
os: "ubuntu-latest",
arch: x64,
}
- {
python-version: "3.9",
tox-env: "py39",
os: "ubuntu-latest",
arch: x64,
}
- {
python-version: "3.10",
tox-env: "py310",
os: "ubuntu-latest",
arch: x64,
}
- {
python-version: "3.11",
tox-env: "py311",
os: "ubuntu-latest",
arch: x64,
}
- {
python-version: "3.12",
tox-env: "py312",
os: "ubuntu-latest",
arch: x64,
}
- {
python-version: "3.12",
tox-env: "py312",
os: "ubuntu-latest",
arch: x86,
}
- {
python-version: "3.12",
tox-env: "py312",
os: "windows-latest",
arch: x64,
}
- {
python-version: "3.12",
tox-env: "py312",
os: "windows-latest",
arch: x86,
}
name: Python ${{ matrix.python-version }} tests (${{ matrix.os }} / ${{ matrix.arch }})
steps:
- uses: actions/checkout@v2
- name: Setup python
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ dist
.coverage*
# files generated during tests
testvenv
tests/yen_pythons
tests/yen_packages
20 changes: 20 additions & 0 deletions scripts/trim_github_release_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import json
import sys
from yen.github import trim_github_release_data


def save_trimmed_release_data(filename: str) -> None:
with open(filename) as file:
data = json.load(file)

trimmed_data = trim_github_release_data(data)
with open(filename, "w") as file:
json.dump(trimmed_data, file, indent=2)


if __name__ == "__main__":
if len(sys.argv) < 2:
print(f"Usage: {sys.orig_argv[0]} {sys.orig_argv[1]} filepath.json")
sys.exit(1)

save_trimmed_release_data(sys.argv[1])
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ yen =
py.typed
activate.sh
fallback_release_data.json
linux_i686_release.json

[tool:pytest]
addopts = --cov --cov-report=term-missing
3 changes: 2 additions & 1 deletion src/yen/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from http.client import HTTPResponse
import os.path
import signal
from functools import partial
Expand Down Expand Up @@ -43,7 +44,7 @@ def handle_sigint(_: object, __: object) -> None:

def read_url(url: str) -> str:
"""Reads the contents of the URL."""
response = urlopen(url)
response: HTTPResponse = urlopen(url)
return response.read().decode()


Expand Down
Loading
Loading