Skip to content

Commit

Permalink
Up.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Jul 26, 2019
1 parent 5cf3ca4 commit b8397dd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
File renamed without changes.
21 changes: 17 additions & 4 deletions ci/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

import os
import sys
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
from os.path import normpath

try:
from os.path import samefile
except ImportError:
def samefile(a, b):
return normpath(abspath(a)) == normpath(abspath(b))


if __name__ == "__main__":
Expand All @@ -31,7 +40,7 @@
python_executable = join(bin_path, "python")
if not os.path.exists(python_executable):
python_executable += '.exe'
if not os.path.samefile(python_executable, sys.executable):
if not samefile(python_executable, sys.executable):
print("Re-executing with: {0}".format(python_executable))
os.execv(python_executable, [python_executable, __file__])

Expand All @@ -48,8 +57,12 @@

tox_environments = [
line.strip()
# WARNING: 'tox' must be installed globally or in the project's virtualenv
for line in subprocess.check_output(['tox', '--listenvs'], universal_newlines=True).splitlines()
# 'tox' need not be installed globally, but must be importable
# by the Python that is running this script.
# This uses sys.executable the same way that the call in
# cookiecutter-pylibrary/hooks/post_gen_project.py
# invokes this bootstrap.py itself.
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
]
tox_environments = [line for line in tox_environments if line.startswith('py')]

Expand Down
File renamed without changes.
18 changes: 10 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
[testenv:bootstrap]
deps =
jinja2
matrix
tox
skip_install = true
commands =
python ci/bootstrap.py
passenv =
*
; a generative tox configuration, see: https://tox.readthedocs.io/en/latest/config.html#generative-envlist

[tox]
Expand Down Expand Up @@ -32,14 +42,6 @@ deps =
commands =
{posargs:pytest --cov --cov-report=term-missing -vv tests}

[testenv:bootstrap]
deps =
jinja2
matrix
skip_install = true
commands =
python ci/bootstrap.py

[testenv:check]
deps =
docutils
Expand Down

0 comments on commit b8397dd

Please sign in to comment.