[Pytest-commit] commit/tox: so... at nur-sober-mc-01.local: added niccodemus' notes and started to specify the builddef feature
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Sat Jun 25 06:20:15 EDT 2016
1 new commit in tox:
https://bitbucket.org/hpk42/tox/commits/489bcd21e06c/
Changeset: 489bcd21e06c
User: so... at nur-sober-mc-01.local
Date: 2016-06-25 10:12:15+00:00
Summary: added niccodemus' notes and started to specify the builddef feature
Affected #: 2 files
diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 489bcd21e06ccc30f1fc85187852815540093c5d doc/drafts/extend-envs-and-packagebuilds.md
--- a/doc/drafts/extend-envs-and-packagebuilds.md
+++ b/doc/drafts/extend-envs-and-packagebuilds.md
@@ -1,5 +1,7 @@
# Extension of environment handling and building packages
+Issue reference: #338
+
*Notes from a discussion at the pytest sprint 2016*
Goal: drive building of packages and the environments needed to test them, exercising the tests and report the results for more than just virtualenvs and python virtualenvs
@@ -64,3 +66,19 @@
* Floris: metadata driven. Package has metadata to the env with what env it is compatible
* Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env)
* Ronny: "package definitions" (this package, this setup command) + matching definitions (matching packages (with wildcards) for environments)
+
+### Feature - builddef
+
+This feature shall allow to specify how to build an artifact in a specific build definition (builddef).
+
+Currently tox uses the current python interpreter to build the artifact (python package) and thus
+does not allow to freely choose the interpreter to build with.
+This means that as of now build environment and test environment are different by design.
+
+Support for different build definitions is implemented by individual tox plugins.
+This would result in a collection of plugins supporting different build definitions (e.g. conda, pyenv, docker, rpm)
+
+Default behavior:
+
+To keep backwards-compatibility, a python package is built with the python interpreter tox is executed with,
+using sdist. This does not require any builddef specification in tox.ini.
diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 489bcd21e06ccc30f1fc85187852815540093c5d doc/drafts/tox_conda_notes_niccodemus.md
--- /dev/null
+++ b/doc/drafts/tox_conda_notes_niccodemus.md
@@ -0,0 +1,84 @@
+[tox]
+envlist=py27,py35
+
+[testenv]
+commands= py.test --timeout=180 {posargs:tests}
+deps=pytest>=2.3.5
+ pytest-timeout
+
+# USE CASE 1: plain conda, with deps on tox.ini
+create_env_command = conda create --prefix {envdir} python={python_version}
+install_command = conda install --prefix {envdir} {opts} {packages}
+list_dependencies_command = conda list --prefix {envdir}
+
+# deprecated: see tox_create_popen hook
+linux:env_activate_command=source activate {envdir}
+win:env_activate_command=activate.bat {envdir}
+
+# USE CASE 2: plain conda, using requirements.txt
+install_command = conda install --prefix {envdir} {opts} --file requirements.txt
+
+# USE CASE 3: conda env
+create_env_command = conda env create --prefix {envdir} python={python_version} --file environment.yml
+install_command =
+
+[testenv]
+type=virtualenv
+type=venv
+type=conda
+type=conda-reqs
+type=conda-env
+
+1. Create a new ``create_env_command`` option.
+;2. Create a new ``env_activate_command`` option (also consider how to make that platform dependent).
+2. New substitution variable: {python_version} ('3.4', '2.7', etc')
+3. env type concept: different types change the default options.
+
+1. tox_addoption can now add new "testenv" sections to tox.ini:
+
+[virtualenv]
+[conda]
+[venv]
+
+2. extend hooks:
+
+ * tox_addoption
+ * tox_configure
+ for each requested env in config:
+ tox_testenv_up_to_date(envmeta)
+ tox_testenv_create(envmeta)
+ tox_testenv_install_deps(envmeta, env)
+ tox_runtest_pre(envmeta, env)
+ tox_runtest(envmeta, env, popen)
+ tox_runtest_post(envmeta, env)
+
+3. separate virtualenv details from "VirtualEnv" class into a plugin.
+
+[tox]
+envlist={py27,py35}-{sdist,wheel,conda}
+
+[package-sdist]
+command = python setup.py sdist
+
+[package-wheel]
+command = python setup.py bdist_wheel
+
+[package-conda]
+command = conda build ./conda-recipe
+
+[testenv:{sdist,wheel}]
+commands = py.test
+
+[testenv:conda]
+packages = sdist,wheel
+commands = py.test --conda-only
+
+* tox_addoption
+* tox_get_python_executable
+* tox_configure
+for each requested env in config:
+ tox_testenv_create(envmeta)
+ tox_testenv_install_deps(envmeta, env)
+ tox_runtest_pre(envmeta, env)
+ tox_runtest(envmeta, env, popen)
+ tox_runtest_post(envmeta, env)
Repository URL: https://bitbucket.org/hpk42/tox/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list