-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
137 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import os | ||
|
||
from setuptools.command.egg_info import egg_info as _egg_info | ||
|
||
|
||
class egg_info(_egg_info): | ||
def finalize_options(self): | ||
if self.egg_base is not None: | ||
script_path = os.path.abspath(self.distribution.script_name) | ||
script_dir = os.path.dirname(script_path) | ||
self.egg_base = os.path.join(script_dir, self.egg_base) | ||
|
||
_egg_info.finalize_options(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
"""test_command_line | ||
---------------------------------- | ||
Tests for various command line functionality. | ||
""" | ||
|
||
from . import project_setup_py_test, push_dir | ||
|
||
|
||
@project_setup_py_test(("samples", "hello"), ["--help"]) | ||
def test_help(capsys): | ||
out, err = capsys.readouterr() | ||
assert "scikit-build options" in out | ||
assert "--build-type" in out | ||
assert "Global options:" in out | ||
assert "usage:" in out | ||
|
||
|
||
def test_no_command(): | ||
with push_dir(): | ||
|
||
@project_setup_py_test(("samples", "hello"), [""]) | ||
def run(): | ||
pass | ||
|
||
failed = False | ||
try: | ||
run() | ||
except SystemExit as e: | ||
failed = e.args[0].startswith('invalid command name') | ||
|
||
assert failed | ||
|
||
|
||
def test_too_many_separators(): | ||
with push_dir(): | ||
|
||
@project_setup_py_test(("samples", "hello"), ["--"] * 3) | ||
def run(): | ||
pass | ||
|
||
failed = False | ||
try: | ||
run() | ||
except SystemExit as e: | ||
failed = e.args[0].startswith('ERROR: Too many') | ||
|
||
assert failed |