Skip to content
Closed
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
60 changes: 60 additions & 0 deletions .github/workflows/create_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

name: Publish package

on:
push:
branches: [ master, github_actions ]
tags:
- '*'
pull_request:
branches:
- '*'


jobs:
build-wheel:
runs-on: ubuntu-latest

steps:
- name: Clone github repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- run: pip install build
- run: python -m build

- name: Upload wheels to GH artifacts
uses: actions/upload-artifact@v7
with:
name: wheel
path: dist/

upload-wheel:
runs-on: ubuntu-latest
needs: [build-wheel]

steps:
- name: Clone github repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- uses: actions/download-artifact@v8
with:
pattern: wheel*
path: dist/

- name: Publish to test PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages-dir: dist/
skip-existing: true
repository-url: https://test.pypi.org/legacy/
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include LICENSE
include README.md
include jdev2026_python_wheel_thomas_baudier/data/*.npz
Empty file.
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from importlib.resources import files

import numpy as np

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

# Load the list of primes and break RSA to find d
primes = np.load("primes.npz").tolist()
data_path = files("jdev2026_python_wheel_thomas_baudier.data") / "primes.npz"
primes = np.load(data_path).tolist()
d = break_rsa_with_primes(n, e, primes)

# Decrypting the message
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

[project]
name = "jdev2026-python-wheel-thomas-baudier"
version = "0.1.0"
description = "Demo package"
authors = [{name="Thomas"}]
readme = "README.md"
requires-python = ">=3.10"

dependencies = [
"numpy",
]

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"


[tool.setuptools.package-data]
"jdev2026_python_wheel_thomas_baudier" = ["data/*.npz"]

[project.scripts]
decrypt-tool = "jdev2026_python_wheel_thomas_baudier.decrypt_rsa:main"