Commit a2daaa02 authored by ∞'s avatar 💻

Merge branch 'jpic' into 'master'

Config refactor

See merge request !9
parents a6859b4d ec8ea6ed
Pipeline #3709 passed with stages
in 44 seconds
image: yourlabs/python
qa:
stage: test
image: yourlabs/python
script: flake8
pytest:
stage: test
image: yourlabs/python
script:
- pip install -e .[test]
- py.test --cov . -v
- ./sh.yml test
pypi:
stage: deploy
image: yourlabs/python
script: pypi-release
......@@ -36,6 +36,7 @@ class Parser:
if not self.command:
self.command = self.group[self.group.default_command]
self.spec = inspect.getfullargspec(self.command.target)
for arg in self.argv:
self.append(arg)
......@@ -61,9 +62,8 @@ class Parser:
return value
def append(self, arg):
spec = inspect.getfullargspec(self.command.target)
filled = False
if not spec.varargs and len(spec.args) == len(self.funcargs):
if not self.spec.varargs and len(self.spec.args) == len(self.funcargs):
filled = True
if filled:
......
......@@ -9,6 +9,8 @@ setup(
extras_require=dict(
test=[
'freezegun',
'pytest',
'pytest-cov',
],
),
author='James Pic',
......
#!/usr/bin/env shyml
name: env
hook: before
help: Global environment variables and fs perms setup
env:
DEBUG: 1
DJANGO_SETTINGS_MODULE: crudlfap_example.settings
script: |
test -n "${CI_COMMIT_SHA-}" || CI_COMMIT_SHA=$(git rev-parse --short HEAD)
export img=yourlabs/crudlfap:$CI_COMMIT_SHA
test -z "${USER-}" || sudo chown -R ${USER}. .
---
name: install
help: |
Setup and activate a venv for a python executable
If venv=none, it will not do any venv.
If venv=user, it will use pip install --user.
script: |
if [ "${venv-}" = "user" ]; then
pip_install="pip install --user"
elif [ "${venv-}" != "none" ]; then
export python="${python-python3}"
export path="${path-.venv.$python}"
test -d $path || virtualenv --python=$python $path
set +eux; echo activating $path; source $path/bin/activate; set -eux
fi
${pip_install-pip install} -Ue .[test]
---
name: test
help: Run test in a python3 venv by default.
requires: [install]
script: py.test -vv --cov cli2 --strict -r fEsxXw ${@-cli2}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment