Skip to content

3.0.0 #31

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

Merged
merged 11 commits into from
Apr 1, 2024
Merged
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
29 changes: 2 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
tags:
- v*
branches:
- master
pull_request:
branches:
- master
Expand Down Expand Up @@ -34,7 +32,7 @@ jobs:
fetch-depth: 0

- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_ARCHS_MACOS: x86_64
HATCH_BUILD_HOOKS_ENABLE: "true"
Expand All @@ -45,28 +43,6 @@ jobs:
path: wheelhouse/*.whl
if-no-files-found: error

pure-python-wheel-and-sdist:
name: Build a pure Python wheel and source distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
# Fetch all tags
fetch-depth: 0

- name: Install build dependencies
run: python -m pip install --upgrade build

- name: Build
run: python -m build

- uses: actions/upload-artifact@v2
with:
name: artifacts
path: dist/*
if-no-files-found: error

binary-wheels-arm:
name: Build Linux wheels for ARM
runs-on: ubuntu-latest
Expand All @@ -88,7 +64,7 @@ jobs:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS_LINUX: aarch64
HATCH_BUILD_HOOKS_ENABLE: "true"
Expand All @@ -103,7 +79,6 @@ jobs:
name: Publish release
needs:
- binary-wheels-standard
- pure-python-wheel-and-sdist
- binary-wheels-arm
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- new-ci
pull_request:
branches:
- master
Expand All @@ -16,6 +15,7 @@ concurrency:
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
PYTHONIOENCODING: "utf8"

jobs:
run:
Expand All @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand All @@ -35,8 +35,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
run: pip install --upgrade --pre hatch
- name: Install Ward
run: pip install --upgrade --pre ward

- name: Install project
run: pip install .

- name: Run tests
run: hatch run tests
run: ward
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ vgcore.*
_pointers.cpython*
*.egg-info/
wheelhouse/
gen.py
ext/
*.o
compile_flags.txt
a.py
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,31 @@ print(text) # world hello
```

```py
from pointers import c_malloc as malloc, c_free as free, strcpy, printf
from pointers import c_malloc, c_free, strcpy, printf

ptr = malloc(3)
ptr = c_malloc(3)
strcpy(ptr, "hi")
printf("%s\n", ptr)
free(ptr)
printf("%s\n", ptr) # hi
c_free(ptr)
```

```py
from pointers import malloc, free

my_str = malloc(103)
my_str <<= "hi"
second_str = my_str[51]
second_str <<= "bye"
print(*my_str, *second_str) # hi bye
free(my_str)
```

### Features

- Fully type safe
- Pythonic pointer API
- Bindings for the entire C standard library
- Segfaults
- Bindings for the entire C standard library and CPython ABI
- Segfaults

### Why does this exist?

Expand Down
10 changes: 1 addition & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,11 @@ fprintf(file, "hello world")
fclose(file)
```

### What's new in 2.0.0?

- Reworked documentation
- Several bug fixes
- Optimized internal API
- Better and fixed type safety
- New memory safety features

### Features

- Fully type safe
- Pythonic pointer API
- Bindings for the entire C standard library
- Bindings for the entire C standard library and CPython ABI
- Segfaults

### Why does this exist?
Expand Down
1 change: 1 addition & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
::: pointers.exceptions
::: pointers.magic
::: pointers._utils
::: pointers.var_pointer
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build]
command = "hatch run docs:build"
command = "pip install mkdocs mkdocstrings[python] && mkdocs build"
publish = "site"
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ readme = "README.md"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
"typing_extensions",
"varname"
]
version = "2.6.0"
version = "3.0.0"

[project.urls]
Documentation = "https://pointers.zintensity.dev"
Expand Down
Loading