Commit Graph

18 Commits

Author SHA1 Message Date
Miro Hrončok
50464a4b19 Satisfy the flake8 linter, unify quotation marks 2019-10-25 17:07:29 +02:00
Miro Hrončok
d5c3fb3c5a When tox fails, print tox output before failing
Previously, it wasn't possible to see why tox failed:

...
Requirement satisfied: tox-current-env >= 0.0.2
   (installed: tox-current-env 0.0.2)
Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 269, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 221, in generate_requires
    generate_tox_requirements(toxenv, requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 184, in generate_tox_requirements
    r = subprocess.run(
  File "/usr/lib64/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['tox', '--print-deps-to-file', '/tmp/tmp96smu4rv', '-qre', 'py38']' returned non-zero exit status 1.

Now it is:

...
Requirement satisfied: tox-current-env >= 0.0.2
   (installed: tox-current-env 0.0.2)
ERROR: tox config file (either pyproject.toml, tox.ini, setup.cfg) not found
Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 270, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 222, in generate_requires
    generate_tox_requirements(toxenv, requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 193, in generate_tox_requirements
    r.check_returncode()
  File "/usr/lib64/python3.8/subprocess.py", line 444, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['tox', '--print-deps-to-file', '/tmp/tmpwp8sffv1', '-qre', 'py38']' returned non-zero exit status 1.

Inspired by https://src.fedoraproject.org/rpms/python-chaospy/pull-request/1#comment-32750
2019-10-25 16:57:01 +02:00
Petr Viktorin
d262d909f5 Use importlib_metadata rather than pip freeze 2019-09-18 16:16:17 +02:00
Miro Hrončok
fda0a23075 -t means "use tox", -e means "use this toxenv", -e implies -t
Further fixes
2019-08-13 14:42:21 +02:00
Miro Hrončok
c975fbe6ec --toxenv implies --runtime 2019-08-13 14:05:50 +02:00
Miro Hrončok
7ba1a33967 Use tox with --print-deps-to-file instead of parsing stdout 2019-08-12 17:29:26 +02:00
Miro Hrončok
8a60635881 Allow to fetch test dependencies from tox 2019-07-26 15:07:11 +02:00
Petr Viktorin
aca2f6a0c4 Mark multiple extras as not supported yet 2019-07-18 11:00:23 +02:00
Petr Viktorin
d6e6bb7dfb Allow specifying extras for build dependencies 2019-07-18 10:50:13 +02:00
Petr Viktorin
3600e9832d Adjust help and error messages 2019-07-18 09:24:02 +02:00
Petr Viktorin
c7e7d1e003 Ignore extra requirements (rather than fail) 2019-07-18 09:10:09 +02:00
Petr Viktorin
bc156c4460 Generate run-time requirements for tests 2019-07-18 08:59:44 +02:00
Petr Viktorin
5abd40fa6b Remove unused return value 2019-07-17 16:25:20 +02:00
Petr Viktorin
095970b345 Fix call to pip
Use sys.executable and decode the output
2019-07-17 16:21:42 +02:00
Petr Viktorin
0878a7a9a4 Remove unused CLI argument 2019-07-17 16:06:54 +02:00
Petr Viktorin
50645e10a3 Refactor and add tests 2019-07-17 15:57:02 +02:00
Petr Viktorin
e6c1981103 Clean up try blocks
- minimize code in try blocks
- remove "except Exception" (global error handling to be added later)
2019-07-17 12:29:05 +02:00
Miro Hrončok
fdf511644e Add %pyproject_buildrequires 2019-07-05 11:28:55 +02:00