Skip to content

Commit

Permalink
Merge pull request #15 from Amulet-Team/cpp
Browse files Browse the repository at this point in the history
Replace cython with pybind11
  • Loading branch information
gentlegiantJGC authored Oct 30, 2024
2 parents 47c490e + a8fcac2 commit fc83aa1
Show file tree
Hide file tree
Showing 22 changed files with 1,911 additions and 814 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ jobs:
fail-fast: false
matrix:
cfg:
- { os: windows-latest, architecture: x64, python-version: "3.8" }
- { os: windows-latest, architecture: x86, python-version: "3.8" }
- { os: macos-13, architecture: x64, python-version: "3.8" }
- { os: macos-latest, architecture: arm64, python-version: "3.8" }
- { os: windows-latest, architecture: x64, python-version: "3.9" }
- { os: windows-latest, architecture: x86, python-version: "3.9" }
- { os: macos-13, architecture: x64, python-version: "3.9" }
- { os: macos-latest, architecture: arm64, python-version: "3.9" }
- { os: windows-latest, architecture: x64, python-version: "3.10" }
- { os: windows-latest, architecture: x86, python-version: "3.10" }
- { os: macos-13, architecture: x64, python-version: "3.10" }
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/python-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ jobs:
strategy:
matrix:
cfg:
- { os: windows-latest, architecture: x64, python-version: "3.8" }
- { os: windows-latest, architecture: x86, python-version: "3.8" }
- { os: macos-13, architecture: x64, python-version: "3.8" }
- { os: macos-latest, architecture: arm64, python-version: "3.8" }
- { os: ubuntu-latest, architecture: x64, python-version: "3.8" }
- { os: windows-latest, architecture: x64, python-version: "3.9" }
- { os: windows-latest, architecture: x86, python-version: "3.9" }
- { os: macos-13, architecture: x64, python-version: "3.9" }
- { os: macos-latest, architecture: arm64, python-version: "3.9" }
- { os: ubuntu-latest, architecture: x64, python-version: "3.9" }
- { os: windows-latest, architecture: x64, python-version: "3.10" }
- { os: windows-latest, architecture: x86, python-version: "3.10" }
- { os: macos-13, architecture: x64, python-version: "3.10" }
Expand Down
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ dmypy.json
# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/

/src/leveldb/*.cpp
# Visual Studio
*.ilk
*.exp
*.lib
*.pdb
sln/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "zlib"]
path = zlib
path = submodules/zlib
url = https://github.com/madler/zlib
[submodule "leveldb-mcpe"]
path = leveldb-mcpe
path = submodules/leveldb-mcpe
url = https://github.com/Amulet-Team/leveldb-mcpe
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
recursive-include src/leveldb *.py *.pyi *.pyx *.pxd
recursive-include src/leveldb *.py *.pyi *.hpp *.cpp
recursive-include bin *.lib
recursive-include zlib *.h
recursive-include leveldb-mcpe *.h *.cc
include leveldb_mcpe.pxd
include versioneer.py
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Amulet LevelDB

A Cython wrapper for Mojang's modified LevelDB library.
A pybind11 wrapper for Mojang's modified LevelDB library.


## Install
Expand All @@ -17,4 +17,4 @@ print(db.get(b"key"))
# b"value"
```

See the [source code](src/leveldb/_leveldb.pyx) for full documentation.
See the [source code](src/leveldb/__init__leveldb.py.cpp) for full documentation.
196 changes: 0 additions & 196 deletions leveldb_mcpe.pxd

This file was deleted.

2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
disallow_untyped_defs = True
check_untyped_defs = True
warn_return_any = True
python_version = 3.8
python_version = 3.9
mypy_path = $MYPY_CONFIG_FILE_DIR/src
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
requires = [
"setuptools >= 42",
"wheel",
"cython >= 3.0.0a11",
"versioneer",
"pybind11 ~= 2.12",
"Amulet-pybind11-extensions @ git+https://github.com/Amulet-Team/Amulet-pybind11-extensions.git@6d272873c277f1aeda94740d1897ee3464803bce",
"versioneer"
]
build-backend = "setuptools.build_meta"
9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ author_email = [email protected]
classifiers=
Programming Language :: Python :: 3
Operating System :: OS Independent
description = A Cython wrapper for Mojang's custom LevelDB.
description = A pybind11 wrapper for Mojang's custom LevelDB.
long_description = file: README.md
long_description_content_type = text/markdown
platforms = any
Expand All @@ -16,8 +16,7 @@ platforms = any
packages = find_namespace:
package_dir =
= src
zip_safe = False
python_requires = ~=3.8
python_requires = ~=3.10
[options.packages.find]
where = src
Expand All @@ -37,8 +36,10 @@ docs =
dev =
black>=22.3
pre_commit>=1.11.1
cython ~= 3.0
mypy
pybind11_stubgen @ git+https://github.com/Amulet-Team/pybind11-stubgen.git@c3a6ef67ec23d5a39e8cdc73b2c3cd8c1794d6f2
isort
autoflake
# See the docstring in versioneer.py for instructions. Note that you must
Expand Down
Loading

0 comments on commit fc83aa1

Please sign in to comment.