Skip to content

Commit

Permalink
Merge pull request #1008 from messense/__main__
Browse files Browse the repository at this point in the history
Add support for invoking with `python3 -m maturin`
  • Loading branch information
messense authored Jul 17, 2022
2 parents fbed43f + de41961 commit 0d2056e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ jobs:
if: steps.changes.outputs.changed == 'true'
- run: maturin --version
if: steps.changes.outputs.changed == 'true'
- run: python3 -m maturin --version
if: steps.changes.outputs.changed == 'true'
- name: Upload wheel artifacts
if: steps.changes.outputs.changed == 'true'
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

* Add 64-bit RISC-V support by felixonmars in [#1001](https://github.com/PyO3/maturin/pull/1001)
* Add support for invoking with `python3 -m maturin` in [#1008](https://github.com/PyO3/maturin/pull/1008)

## [0.13.0] - 2022-07-09

Expand Down
9 changes: 9 additions & 0 deletions maturin/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
import sys
from pathlib import Path
import sysconfig

if __name__ == "__main__":
scripts_dir = sysconfig.get_path("scripts")
maturin = Path(scripts_dir) / "maturin"
os.execv(maturin, [str(maturin)] + sys.argv[1:])

0 comments on commit 0d2056e

Please sign in to comment.