diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4760030a..ac1ecf6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,7 +103,7 @@ jobs: - run: rustup update && rustup target add aarch64-apple-darwin - run: pip install maturin - run: sed -i 's/path="..\/lib", //g' python/Cargo.toml - - run: maturin build --release -m python/Cargo.toml --universal2 + - run: maturin build --release --no-sdist --universal2 -m python/Cargo.toml - run: maturin build --release --no-sdist -m python/Cargo.toml - uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -138,6 +138,25 @@ jobs: with: files: target/wheels/* + publish_pypi_stdist: + runs-on: ubuntu-latest + needs: publish_crates + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - run: pip install maturin + - run: sed -i 's/path="..\/lib", //g' python/Cargo.toml + - run: maturin sdist -m python/Cargo.toml + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} + packages_dir: target/wheels + - uses: softprops/action-gh-release@v1 + with: + files: target/wheels/* + publish_npm: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index de818a59..9436831c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -89,13 +89,12 @@ jobs: - uses: actions/setup-python@v2 with: python-version: "3.10" - - run: python -m venv python/venv - - run: source python/venv/bin/activate && pip install --upgrade maturin sphinx - - run: source venv/bin/activate && maturin develop - working-directory: ./python - - run: source ../venv/bin/activate && python -m unittest + - run: pip install --upgrade maturin sphinx + - run: maturin sdist -m python/Cargo.toml + - run: pip install target/wheels/*.tar.gz + - run: python -m unittest working-directory: ./python/tests - - run: source ../venv/bin/activate && sphinx-build -M doctest . build + - run: sphinx-build -M doctest . build working-directory: ./python/docs - - run: source ../venv/bin/activate && sphinx-build -M html . build + - run: sphinx-build -M html . build working-directory: ./python/docs diff --git a/python/Cargo.lock b/python/Cargo.lock new file mode 120000 index 00000000..09fdd3b6 --- /dev/null +++ b/python/Cargo.lock @@ -0,0 +1 @@ +../Cargo.lock \ No newline at end of file diff --git a/python/pyproject.toml b/python/pyproject.toml index 5e8eb011..7fac216a 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -27,3 +27,6 @@ Documentation = "https://oxigraph.org/pyoxigraph/" Homepage = "https://oxigraph.org/pyoxigraph/" Source = "https://github.com/oxigraph/oxigraph/tree/master/python" Tracker = "https://github.com/oxigraph/oxigraph/issues" + +[tool.maturin] +cargo-extra-args = "--frozen"