Skip to content

Commit beac409

Browse files
committed
Create the folder jdev2026_python_wheel_thomas_baudier containing the code to create the wheel
Add .github folder containg the automatization of the creation of the wheel
1 parent 3746249 commit beac409

8 files changed

Lines changed: 90 additions & 1 deletion

File tree

.github/workflows/create_wheel.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
name: Publish package
3+
4+
on:
5+
push:
6+
branches: [ master, working_example ]
7+
tags:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- '*'
12+
13+
14+
jobs:
15+
build-wheel:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Clone github repository
20+
uses: actions/checkout@v6
21+
- name: Set up Python
22+
uses: actions/setup-python@v6
23+
with:
24+
python-version: "3.14"
25+
26+
- run: pip install build
27+
- run: python -m build
28+
29+
- name: Upload wheels to GH artifacts
30+
uses: actions/upload-artifact@v7
31+
with:
32+
name: wheel
33+
path: dist/
34+
35+
upload-wheel:
36+
runs-on: ubuntu-latest
37+
needs: [build-wheel]
38+
39+
steps:
40+
- name: Clone github repository
41+
uses: actions/checkout@v6
42+
- name: Set up Python
43+
uses: actions/setup-python@v6
44+
with:
45+
python-version: "3.14"
46+
47+
- uses: actions/download-artifact@v8
48+
with:
49+
pattern: wheel*
50+
path: dist/
51+
52+
- name: Publish to test PyPI
53+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
user: __token__
57+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
58+
packages-dir: dist/
59+
skip-existing: true
60+
repository-url: https://test.pypi.org/legacy/

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include LICENSE
2+
include README.md
3+
include jdev2026_python_wheel_thomas_baudier/data/*.npz

jdev2026_python_wheel_thomas_baudier/__init__.py

Whitespace-only changes.

jdev2026_python_wheel_thomas_baudier/data/__init__.py

Whitespace-only changes.

primes.npz renamed to jdev2026_python_wheel_thomas_baudier/data/primes.npz

File renamed without changes.

decrypt_rsa.py renamed to jdev2026_python_wheel_thomas_baudier/decrypt_rsa.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from importlib.resources import files
2+
13
import numpy as np
24

35
from .helpers import (
@@ -31,7 +33,8 @@ def run_decrypt_rsa():
3133
show_text_gui(str(c), title="Encrypted message", label="Encrypted message:")
3234

3335
# Load the list of primes and break RSA to find d
34-
primes = np.load("primes.npz").tolist()
36+
data_path = files("jdev2026_python_wheel_thomas_baudier.data") / "primes.npz"
37+
primes = np.load(data_path).tolist()
3538
d = break_rsa_with_primes(n, e, primes)
3639

3740
# Decrypting the message

helpers.py renamed to jdev2026_python_wheel_thomas_baudier/helpers.py

File renamed without changes.

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
[project]
3+
name = "jdev2026-python-wheel-thomas-baudier"
4+
version = "0.1.0"
5+
description = "Demo package"
6+
authors = [{name="Thomas"}]
7+
readme = "README.md"
8+
requires-python = ">=3.10"
9+
10+
dependencies = [
11+
"numpy",
12+
]
13+
14+
[build-system]
15+
requires = ["setuptools>=61.0", "wheel"]
16+
build-backend = "setuptools.build_meta"
17+
18+
19+
[tool.setuptools.package-data]
20+
"jdev2026_python_wheel_thomas_baudier" = ["data/*.npz"]
21+
22+
[project.scripts]
23+
decrypt-tool = "jdev2026_python_wheel_thomas_baudier.decrypt_rsa:main"

0 commit comments

Comments
 (0)