python-envdir: update to 1.0.1.

Closes: #12929 [via git-merge-pr]
This commit is contained in:
maxice8 2018-03-26 13:01:12 -03:00 committed by Michael Aldridge
parent d4fb971d93
commit 2b4889e086
3 changed files with 28 additions and 119 deletions

View File

@ -1,108 +0,0 @@
--- envdir/test_envdir.py
+++ envdir/test_envdir.py
@@ -253,39 +253,39 @@ def test_read(tmpenvdir):
assert 'READ' in applied
-def test_read_magic_dir(capfd, tmpdir):
- "Python usage with magic envdir"
- tmp = tmpdir.mkdir('envdir')
- tmp.join('READ_MAGIC').write('test')
- magic_scripts = tmpdir.join('test_magic.py')
- magic_scripts.write("""
-import envdir, os, sys
-envdir.read()
-if 'READ_MAGIC' in os.environ:
- sys.exit(42)
-""")
- status = subprocess.call(['python', str(magic_scripts)])
- assert status == 42
-
- # this should raise a Response with an error because envdir.run()
- # can't have all arguments
- with py.test.raises(SystemExit) as response:
- envdir.run('envdir', str(tmp))
- out, err = capfd.readouterr()
-
- if py.std.sys.version_info[:2] == (2, 6):
- assert response.value == 2
- else:
- assert response.value.code == 2
- assert "incorrect number of arguments" in err
-
- with py.test.raises(SystemExit) as response:
- envdir.run()
- out, err = capfd.readouterr()
- if py.std.sys.version_info[:2] == (2, 6):
- assert response.value == 2
- else:
- assert response.value.code == 2
+#def test_read_magic_dir(capfd, tmpdir):
+# "Python usage with magic envdir"
+# tmp = tmpdir.mkdir('envdir')
+# tmp.join('READ_MAGIC').write('test')
+# magic_scripts = tmpdir.join('test_magic.py')
+# magic_scripts.write("""
+#import envdir, os, sys
+#envdir.read()
+#if 'READ_MAGIC' in os.environ:
+# sys.exit(42)
+#""")
+# status = subprocess.call(['python', str(magic_scripts)])
+# assert status == 42
+#
+# # this should raise a Response with an error because envdir.run()
+# # can't have all arguments
+# with py.test.raises(SystemExit) as response:
+# envdir.run('envdir', str(tmp))
+# out, err = capfd.readouterr()
+#
+# if py.std.sys.version_info[:2] == (2, 6):
+# assert response.value == 2
+# else:
+# assert response.value.code == 2
+# assert "incorrect number of arguments" in err
+#
+# with py.test.raises(SystemExit) as response:
+# envdir.run()
+# out, err = capfd.readouterr()
+# if py.std.sys.version_info[:2] == (2, 6):
+# assert response.value == 2
+# else:
+# assert response.value.code == 2
def test_read_existing_var(tmpenvdir):
@@ -303,20 +303,18 @@ def test_write(tmpenvdir):
envdir.read(str(tmpenvdir))
assert os.environ['WRITE'] == 'test'
-
-def test_write_magic(tmpdir):
- tmp = tmpdir.mkdir('envdir')
- magic_scripts = tmpdir.join('test_magic_write.py')
- magic_scripts.write("""
-import envdir, os, sys
-env = envdir.open()
-env['WRITE_MAGIC'] = 'test'
-""")
- subprocess.call(['python', str(magic_scripts)])
- assert tmp.join('WRITE_MAGIC').read() == 'test'
- envdir.read(str(tmp))
- assert os.environ['WRITE_MAGIC'] == 'test'
-
+#def test_write_magic(tmpdir):
+# tmp = tmpdir.mkdir('envdir')
+# magic_scripts = tmpdir.join('test_magic_write.py')
+# magic_scripts.write("""
+#import envdir, os, sys
+#env = envdir.open()
+#env['WRITE_MAGIC'] = 'test'
+#""")
+# subprocess.call(['python', str(magic_scripts)])
+# assert tmp.join('WRITE_MAGIC').read() == 'test'
+# envdir.read(str(tmp))
+# assert os.environ['WRITE_MAGIC'] == 'test'
def test_context_manager(tmpenvdir):
tmpenvdir.join('CONTEXT_MANAGER').write('test')

View File

@ -1,24 +1,40 @@
# Template file for 'python-envdir'
pkgname=python-envdir
version=0.7
version=1.0.1
revision=1
wrksrc="${pkgname/python-//}-${version}"
build_style=python2-module
hostmakedepends="python-setuptools"
checkdepends="python-pytest"
build_style=python-module
pycompile_module="envdir"
hostmakedepends="python-setuptools python3-setuptools"
depends="python-setuptools"
short_desc="A Python2 port of daemontools' envdir"
maintainer="maxice8 <thinkabit.ukim@gmail.com>"
license="MIT"
homepage="https://github.com/jezdez/envdir"
distfiles="${PYPI_SITE}/e/envdir/envdir-${version}.tar.gz"
checksum=296ea3b651c429a31465684f03fef52cd580427acba5d0351009180740924009
distfiles="https://github.com/jezdez/envdir/archive/${version}.tar.gz"
checksum=779a308a07a673f391db87ef639d4b0f9921238bba02dd3e98c3281520faee95
noarch=yes
do_check() {
pytest2
}
alternatives="
python-envdir:envdir:/usr/bin/envdir2
python-envdir:envshell:/usr/bin/envshell2
"
post_install() {
vlicense "${FILESDIR}"/LICENSE
vlicense LICENSE
}
python3-envdir_package() {
alternatives="
python-envdir:envdir:/usr/bin/envdir3
python-envdir:envshell:/usr/bin/envshell3
"
noarch=yes
pycompile_module="envdir"
depends="python3-setuptools"
short_desc="${short_desc/Python2/Python3}"
pkg_install() {
vmove usr/bin/*3
vmove usr/lib/python3*
vlicense LICENSE
}
}

1
srcpkgs/python3-envdir Symbolic link
View File

@ -0,0 +1 @@
python-envdir