Skip to content

Commit

Permalink
Release 0.0.6.1-post1
Browse files Browse the repository at this point in the history
Bump README for PyPI
  • Loading branch information
James-E-A committed Jan 26, 2024
2 parents b33fec8 + cff58ba commit 574e1be
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 21 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/bdist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on: [push]

jobs:
build_wheels:
name: bdist_wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]

steps:
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.3

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD_VERBOSITY: 1
# Python 3.6 is EOL
# CFFI or maybe PQClean doesn't seem to work with musllinux
CIBW_SKIP: "cp36* *-musllinux_*"
# https://cibuildwheel.readthedocs.io/en/stable/options/#:~:text=cibuildwheel%20doesn%27t%20yet%20ship%20a%20default%20repair%20command%20for%20Windows%2E
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
32 changes: 12 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
Installation
============

Until we get binary wheels published (`#9 <https://github.com/JamesTheAwesomeDude/pypqc/issues/9>`_), you must:

1. Install a C compiler

2. Apply OS-specific fixes:

- If you're on Windows, create a folder ``C:\temp`` and then run ``set "TMPDIR=C:\temp"``. (Workaround for `#14 <https://github.com/JamesTheAwesomeDude/pypqc/issues/14>`_)

- If you're on Linux, install the Python development headers.

3. Run ``pip install pypqc``

Usage
=====

Simply install from PyPI with ``pip install pypqc``, or see "Development" below
if you want to tinker on the codebase!

KEMs
----

Expand Down Expand Up @@ -81,14 +69,16 @@ Dependencies:
- Python 3 (tested mainly on CPython 3.9, 3.10, 3.11, and 3.12; and on PyPy
7.3.12)

- cffi_ (from PyPI; build- and run-time dependency)
- cffi_

- Transitive non-PyPI build-time dependency: `Python Headers`_ (I think these come OOTB on
Windows)
- Transitive non-PyPI build-time dependency: `Python Headers`_ (only Linux users
need to manually install these; they come OOtB on Windows. Not sure about Mac.)

- setuptools_ (from PyPI; build-time dependency only)
- setuptools_ (build-time dependency)

- a C compiler (build-time dependency only)
- wheel_ (build-time dependency)

- a C compiler (build-time dependency)

- If you're on Windows, https://visualstudio.microsoft.com/visual-cpp-build-tools/

Expand Down Expand Up @@ -132,6 +122,8 @@ Getting started:
`support this <https://setuptools.pypa.io/en/latest/userguide/extension.html#setuptools.command.build.SubCommand.editable_mode>`_
before it's even on the table.)

- If you get error 1104 when trying to compile, make a folder ``C:\temp``, then try ``set "TMPDIR=C:\temp"`` and try again. (https://discuss.python.org/t/-/44077/5)

2. Run ``python -m pqc.demo`` to test it. If it prints "OK" and exits, the
functions are almost certainly not broken. (Ideally, run this from a
DIFFERENT directory, such as your home folder, so you can be sure it's
Expand Down
1 change: 1 addition & 0 deletions cffi_modules/_common_cffi_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ def make_pqclean_ffi(build_root, c_header_sources, cdefs, *,
extra_objects=extra_objects,
extra_compile_args=extra_compile_args,
libraries=libraries,
py_limited_api=True
)
return ffibuilder
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pypqc"
version = "0.0.6.1"
version = "0.0.6.1.post1"
description = "Python bindings for the \"PQClean\" post-quantum cryptography library."
readme = "README.rst"
urls = {"Homepage" = "https://github.com/JamesTheAwesomeDude/pypqc"}
Expand All @@ -16,4 +16,5 @@ namespaces = false
requires = [
'cffi >= 1.14.5',
'setuptools >= 49.5.0',
'wheel >= 0.38.0',
]
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@
# https://github.com/pypa/setuptools/issues/1040

from setuptools import setup
from distutils.command.build_ext import build_ext as _build_ext
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel


class bdist_wheel_abi_none(_bdist_wheel):
"""https://github.com/joerick/python-ctypes-package-sample/blob/7db688cd6ee32ae95bce0f75fb7d806926e20252/setup.py#L29"""
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False

def get_tag(self):
python, abi, plat = _bdist_wheel.get_tag(self)
return "py3", "none", plat


setup(
cmdclass={"bdist_wheel": bdist_wheel_abi_none},
cffi_modules=[
'cffi_modules/dilithium2_clean.py:ffi',
'cffi_modules/dilithium3_clean.py:ffi',
Expand Down

0 comments on commit 574e1be

Please sign in to comment.