Skip to content

Commit

Permalink
Only allow a single command at a time (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba authored Nov 3, 2023
1 parent 150a466 commit b8f5890
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Test

on:
push:
Expand All @@ -16,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12-dev']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand All @@ -35,7 +32,15 @@ jobs:
run: pytest
env:
PYTHON_CONFIG: python3-config
- name: Check self builds
run: python -m pymsbuild sdist wheel
- name: Check self build (in-place)
run: python -m pymsbuild
env:
PYTHON_CONFIG: python3-config
- name: Check self build (sdist)
run: python -m pymsbuild sdist
env:
PYTHON_CONFIG: python3-config
- name: Check self build (wheel)
run: python -m pymsbuild wheel
env:
PYTHON_CONFIG: python3-config
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install packaging
- name: Build
run: python -m pymsbuild -d dist sdist wheel
- name: Build sdist
run: python -m pymsbuild -d dist sdist
env:
GITHUB_REF: ${{ github.ref }}
- name: Build wheel
run: python -m pymsbuild -d dist wheel
env:
GITHUB_REF: ${{ github.ref }}
- name: Publish
Expand Down
15 changes: 8 additions & 7 deletions pymsbuild/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ def parse_args():
parser.add_argument(
"command",
type=str,
nargs="*",
help="""one or more of 'init', 'generate', 'sdist', 'wheel', 'pack', 'distinfo', 'clean'
default="build_in_place",
nargs="?",
help="""one of 'init', 'generate', 'sdist', 'wheel', 'pack', 'distinfo', 'clean'
init: Initialise a new _msbuild.py file.
generate: Generate the build files without building.
Expand All @@ -113,7 +114,7 @@ def parse_args():

ns = parse_args()
if not getattr(ns, "command", None):
ns.command = ["build_in_place"]
ns.command = "build_in_place"

if ns.verbose:
print("pymsbuild", pymsbuild.__version__, "running on", sys.version.partition("\n")[0])
Expand Down Expand Up @@ -152,7 +153,7 @@ def parse_args():
}


for cmd in ns.command:
cmd = COMMANDS.get(cmd, cmd)
f = getattr(bs, cmd)
f()
cmd = ns.command
cmd = COMMANDS.get(cmd, cmd)
f = getattr(bs, cmd)
f()

0 comments on commit b8f5890

Please sign in to comment.