Skip to content

Commit b9cd9b2

Browse files
Update build tools (#10)
Require pre-compiled libraries when installing for tests
1 parent 280187f commit b9cd9b2

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ runs:
126126
127127
128128
- name: Clone Amulet-zlib
129-
uses: Amulet-Team/checkout-pep440@v1
129+
uses: Amulet-Team/checkout-pep440@v2
130130
with:
131131
repository: 'Amulet-Team/Amulet-zlib'
132132
specifier: '==${{ steps.dep.outputs.zlib }}'
@@ -144,7 +144,7 @@ runs:
144144
zlib-specifier: ${{ steps.dep2.outputs.zlib }}
145145

146146
- name: Clone Amulet-NBT
147-
uses: Amulet-Team/checkout-pep440@v1
147+
uses: Amulet-Team/checkout-pep440@v2
148148
with:
149149
repository: 'Amulet-Team/Amulet-NBT'
150150
specifier: '==${{ steps.dep.outputs.nbt }}'
@@ -164,7 +164,7 @@ runs:
164164
nbt-specifier: ${{ steps.dep2.outputs.nbt }}
165165

166166
- name: Clone Amulet-Core
167-
uses: Amulet-Team/checkout-pep440@v1
167+
uses: Amulet-Team/checkout-pep440@v2
168168
with:
169169
repository: 'Amulet-Team/Amulet-Core'
170170
specifier: '==${{ steps.dep.outputs.core }}'

.github/actions/install/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,18 @@ runs:
9191
exit 1
9292
fi
9393
94+
- name: Install Dependencies
95+
shell: bash
96+
run: |
97+
python -m pip install --only-binary amulet-zlib,amulet-nbt,amulet-core amulet-compiler-version${{ inputs.compiler-specifier }} pybind11${{ inputs.pybind11-specifier }} amulet-pybind11-extensions${{ inputs.pybind11-extensions-specifier }} amulet-io${{ inputs.io-specifier }} amulet-zlib${{ inputs.zlib-specifier }} amulet-nbt${{ inputs.nbt-specifier }} amulet-core${{ inputs.core-specifier }}
98+
99+
94100
- name: Install Prebuilt
95101
id: install
96102
shell: bash
97103
continue-on-error: true
98104
run: |
99-
python -m pip install --only-binary amulet-game amulet-compiler-version${{ inputs.compiler-specifier }} pybind11${{ inputs.pybind11-specifier }} amulet-pybind11-extensions${{ inputs.pybind11-extensions-specifier }} amulet-io${{ inputs.io-specifier }} amulet-zlib${{ inputs.zlib-specifier }} amulet-nbt${{ inputs.nbt-specifier }} amulet-core${{ inputs.core-specifier }} amulet-game${{ inputs.game-specifier }}
105+
python -m pip install --only-binary amulet-game,amulet-zlib,amulet-nbt,amulet-core amulet-compiler-version${{ inputs.compiler-specifier }} pybind11${{ inputs.pybind11-specifier }} amulet-pybind11-extensions${{ inputs.pybind11-extensions-specifier }} amulet-io${{ inputs.io-specifier }} amulet-zlib${{ inputs.zlib-specifier }} amulet-nbt${{ inputs.nbt-specifier }} amulet-core${{ inputs.core-specifier }} amulet-game${{ inputs.game-specifier }}
100106
101107
- name: Build
102108
if: steps.install.outcome == 'failure'
@@ -125,7 +131,9 @@ runs:
125131
if: steps.install.outcome == 'failure'
126132
shell: bash
127133
run: |
128-
python -m pip install "${{ github.action_path }}"/../../../dist/amulet_game-*.whl
134+
cache_dir=$(python -m pip cache dir)
135+
rm -rf "$cache_dir"/http*
136+
python -m pip install --only-binary amulet-game,amulet-zlib,amulet-nbt,amulet-core amulet-compiler-version${{ inputs.compiler-specifier }} pybind11${{ inputs.pybind11-specifier }} amulet-pybind11-extensions${{ inputs.pybind11-extensions-specifier }} amulet-io${{ inputs.io-specifier }} amulet-zlib${{ inputs.zlib-specifier }} amulet-nbt${{ inputs.nbt-specifier }} amulet-core${{ inputs.core-specifier }} amulet-game${{ inputs.game-specifier }}
129137
130138
- name: Get __version__
131139
id: get-version

.github/workflows/python-unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
env:
5050
AMULET_FREEZE_COMPILER: 1
5151
run: |
52-
pip install -v .[dev]
52+
pip install --only-binary amulet-compiler-version,amulet-zlib,amulet-nbt,amulet-core -v .[dev]
5353
python tools/compile_tests.py
5454
5555
- name: Test with unittest

requirements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
PYBIND11_REQUIREMENT = "==2.13.6"
88
AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = "~=1.1.0.0a0"
99
AMULET_IO_REQUIREMENT = "~=1.0"
10-
AMULET_ZLIB_REQUIREMENT = "~=1.0.0.0a6"
10+
AMULET_ZLIB_REQUIREMENT = "~=1.0.0.0a7"
1111
AMULET_NBT_REQUIREMENT = "~=5.0.0.0a6"
1212
AMULET_CORE_REQUIREMENT = "~=2.0.3.0a1"
1313

src/amulet/game/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def _init() -> None:
2727
raise RuntimeError(f"Unsupported platform {sys.platform}")
2828

2929
# Import dependencies
30+
import amulet.zlib
3031
import amulet.nbt
3132
import amulet.core
3233

src/amulet/game/_amulet_game.py.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ void init_java(py::module);
1010
void init_module(py::module m)
1111
{
1212
pyext::init_compiler_config(m);
13+
pyext::check_compatibility(py::module::import("amulet.zlib"), m);
1314
pyext::check_compatibility(py::module::import("amulet.nbt"), m);
1415
pyext::check_compatibility(py::module::import("amulet.core"), m);
1516

0 commit comments

Comments
 (0)