Skip to content

Commit

Permalink
Add support for invoking with python3 -m maturin
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jul 17, 2022
1 parent fbed43f commit e14ba96
Show file tree
Hide file tree
Showing 2 changed files with 11 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
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, ["maturin"] + sys.argv[1:])

0 comments on commit e14ba96

Please sign in to comment.