From c071c69e1b5a0d897674a1f7adc6ff32f19400ff Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 27 May 2015 12:49:44 -0300 Subject: [bug] Use BrowserLikePolicyForHTTPS for checking While testing the way that its implemented now, I found out that no check is being made on certificate attributes against the host. I found this simple way of creating a BrowserLikePolicyForHTTPS using a self signed cert and it worked on my test. I used test_https from Soledad for checking this (which we are fixing on another branch). Also, we don't want to depend on twisted for other things than leap.common.http. --- pkg/requirements.pip | 2 -- 1 file changed, 2 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index f875344..1977cc8 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -2,8 +2,6 @@ jsonschema #<=0.8 -- are we done with this conflict? dirspec pyopenssl python-dateutil -Twisted>=12.1 -zope.interface pyzmq txzmq -- cgit v1.2.3 From e1598b233e6d3e3385edc64d5d4204967c4434fb Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 2 Jun 2015 15:05:19 -0300 Subject: [pkg] add pyzmq and txzmq dep versions --- pkg/requirements.pip | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 1977cc8..02fb189 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -2,7 +2,7 @@ jsonschema #<=0.8 -- are we done with this conflict? dirspec pyopenssl python-dateutil -pyzmq -txzmq +pyzmq>=14.4.1 +txzmq>=0.7.3 #autopep8 -- ??? -- cgit v1.2.3 From 78e818ebf64e0ca7a398dca35e951ff273c26fa5 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 22 Jul 2015 17:04:34 -0300 Subject: [tests] added setuptools_trial so the tests run using python setup.py test --- pkg/requirements-testing.pip | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg') diff --git a/pkg/requirements-testing.pip b/pkg/requirements-testing.pip index 932a895..c3c05fd 100644 --- a/pkg/requirements-testing.pip +++ b/pkg/requirements-testing.pip @@ -1 +1,2 @@ mock +setuptools-trial -- cgit v1.2.3 From c5cb769c75c5dc9b3b22b3b3a8102c3244b4edad Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 27 Jul 2015 21:42:47 -0400 Subject: [pkg] add script to install base requirements - update pip - install base reqs, with insecure flags for dirspec. fuck canonical. --- pkg/pip_install_requirements.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 pkg/pip_install_requirements.sh (limited to 'pkg') diff --git a/pkg/pip_install_requirements.sh b/pkg/pip_install_requirements.sh new file mode 100755 index 0000000..8576c8c --- /dev/null +++ b/pkg/pip_install_requirements.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Update pip and install LEAP base requirements. +# For convenience, u1db and dirspec are allowed with insecure flags enabled. +# Use at your own risk. +pip install -U pip +pip install --allow-external dirspec --allow-unverified dirspec -r pkg/requirements.pip -- cgit v1.2.3 From f28824c8f795bdf91cd837aef8516963b53246c6 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 27 Jul 2015 22:32:38 -0400 Subject: [pkg] add AUTHORS file + one-liner to generate it --- pkg/tools/get_authors.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 pkg/tools/get_authors.sh (limited to 'pkg') diff --git a/pkg/tools/get_authors.sh b/pkg/tools/get_authors.sh new file mode 100755 index 0000000..0169bb1 --- /dev/null +++ b/pkg/tools/get_authors.sh @@ -0,0 +1,2 @@ +#!/bin/sh +git log --format='%aN <%aE>' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn | cut -d' ' -f2- -- cgit v1.2.3 From 8668cf04e59bd4c1fe45a7e74cd0c214ae50b052 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 28 Jul 2015 09:55:33 -0400 Subject: [tests] add pep8 to requirements-testing --- pkg/requirements-testing.pip | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg') diff --git a/pkg/requirements-testing.pip b/pkg/requirements-testing.pip index c3c05fd..c5a3ad0 100644 --- a/pkg/requirements-testing.pip +++ b/pkg/requirements-testing.pip @@ -1,2 +1,3 @@ mock setuptools-trial +pep8 -- cgit v1.2.3 From a119dd4fa2fc4a14577fd2d6e32dff950d934193 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 28 Jul 2015 11:41:32 -0400 Subject: [style] more pep8 cleanup --- pkg/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/utils.py b/pkg/utils.py index deace14..521cd4e 100644 --- a/pkg/utils.py +++ b/pkg/utils.py @@ -58,9 +58,9 @@ def parse_requirements(reqfiles=['requirements.txt', if re.match(r'\s*-e\s+', line): pass # do not try to do anything with externals on vcs - #requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', - #line)) - # http://foo.bar/baz/foobar/zipball/master#egg=foobar + # requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', + # line)) + # http://foo.bar/baz/foobar/zipball/master#egg=foobar elif re.match(r'\s*https?:', line): requirements.append(re.sub(r'\s*https?:.*#egg=(.*)$', r'\1', line)) -- cgit v1.2.3 From 638f3edb91ef8c6254d84a2eb083f725da2a878a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 30 Jul 2015 18:29:59 +0200 Subject: [feat] use wheels to install dependencies generate_wheels uses $WHEELHOUSE to generate and store the wheels for requirements.pip and requirements-testing.pip (if it exists). pip_install_requirements.sh installs requirements.pip from them if possible (if not, then it fetches them from pypi) or, if passed the --testing flag, it installs requirements-testing.pip. --- pkg/generate_wheels.sh | 14 ++++++++ pkg/pip_install_requirements.sh | 71 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 81 insertions(+), 4 deletions(-) create mode 100755 pkg/generate_wheels.sh (limited to 'pkg') diff --git a/pkg/generate_wheels.sh b/pkg/generate_wheels.sh new file mode 100755 index 0000000..4cdc34e --- /dev/null +++ b/pkg/generate_wheels.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Generate wheels for dependencies +# For convenience, dirspec is allowed with insecure flags enabled. +# Use at your own risk. + +if [ "$WHEELHOUSE" = "" ]; then + WHEELHOUSE=$HOME/wheelhouse +fi + +pip wheel --wheel-dir $WHEELHOUSE pip +pip wheel --wheel-dir $WHEELHOUSE --allow-external dirspec --allow-unverified dirspec -r pkg/requirements.pip +if [ -f pkg/requirements-testing.pip ]; then + pip wheel --wheel-dir $WHEELHOUSE -r pkg/requirements-testing.pip +fi diff --git a/pkg/pip_install_requirements.sh b/pkg/pip_install_requirements.sh index 8576c8c..949f738 100755 --- a/pkg/pip_install_requirements.sh +++ b/pkg/pip_install_requirements.sh @@ -1,6 +1,69 @@ #!/bin/sh -# Update pip and install LEAP base requirements. -# For convenience, u1db and dirspec are allowed with insecure flags enabled. +# Update pip and install LEAP base/testing requirements. +# For convenience, $insecure_packages are allowed with insecure flags enabled. # Use at your own risk. -pip install -U pip -pip install --allow-external dirspec --allow-unverified dirspec -r pkg/requirements.pip +# See $usage for help + +insecure_packages="dirspec" + +return_wheelhouse() { + if [ "$WHEELHOUSE" = "" ]; then + WHEELHOUSE=$HOME/wheelhouse + fi + + if [ ! -d "$WHEELHOUSE" ]; then + mkdir $WHEELHOUSE + fi + + echo "$WHEELHOUSE" +} + +show_help() { + usage="Usage: $0 [--testing]\n --testing\tInstall dependencies from requirements-testing.pip\n +\t\tOtherwise, it will install requirements.pip" + echo $usage + + exit 1 +} + +process_arguments() { + testing=false + while [ "$#" -gt 0 ]; do + # From http://stackoverflow.com/a/31443098 + case "$1" in + --help) show_help;; + --testing) testing=true; shift 1;; + + -h) show_help;; + -*) echo "unknown option: $1" >&2; exit 1;; + esac + done +} + +return_insecure_flags() { + for insecure_package in $insecure_packages; do + flags="$flags --allow-external $insecure_package --allow-unverified $insecure_package" + done + + echo $flags +} + +return_packages() { + if $testing ; then + packages="-r pkg/requirements-testing.pip" + else + packages="-r pkg/requirements.pip" + fi + + echo $packages +} + +process_arguments $@ +wheelhouse=`return_wheelhouse` +install_options="-U --find-links=$wheelhouse" +insecure_flags=`return_insecure_flags` +packages=`return_packages` + +pip install -U wheel +pip install $install_options pip +pip install $install_options $insecure_flags $packages -- cgit v1.2.3 From f1639503a58c76b00afc0a22b7928661dd08c771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 4 Aug 2015 14:59:36 +0200 Subject: [feat] WHEELHOUSE can be a url + --use-leap-wheels --use-leap-wheels sets --trusted-host (remove it when we have a proper cert) and WHEELHOUSE to https://ftp.lizard.leap.se Until we get ftp.lizard cname, use lizard as the wheels server. --- pkg/pip_install_requirements.sh | 53 +++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'pkg') diff --git a/pkg/pip_install_requirements.sh b/pkg/pip_install_requirements.sh index 949f738..6d8ed28 100755 --- a/pkg/pip_install_requirements.sh +++ b/pkg/pip_install_requirements.sh @@ -1,38 +1,31 @@ -#!/bin/sh +#!/bin/bash # Update pip and install LEAP base/testing requirements. # For convenience, $insecure_packages are allowed with insecure flags enabled. # Use at your own risk. # See $usage for help insecure_packages="dirspec" - -return_wheelhouse() { - if [ "$WHEELHOUSE" = "" ]; then - WHEELHOUSE=$HOME/wheelhouse - fi - - if [ ! -d "$WHEELHOUSE" ]; then - mkdir $WHEELHOUSE - fi - - echo "$WHEELHOUSE" -} +leap_wheelhouse=https://lizard.leap.se/wheels show_help() { - usage="Usage: $0 [--testing]\n --testing\tInstall dependencies from requirements-testing.pip\n -\t\tOtherwise, it will install requirements.pip" - echo $usage + usage="Usage: $0 [--testing] [--use-leap-wheels]\n --testing\t\tInstall dependencies from requirements-testing.pip\n +\t\t\tOtherwise, it will install requirements.pip\n +--use-leap-wheels\tUse wheels from leap.se" + echo -e $usage exit 1 } process_arguments() { testing=false + use_leap_wheels=false + while [ "$#" -gt 0 ]; do # From http://stackoverflow.com/a/31443098 case "$1" in --help) show_help;; --testing) testing=true; shift 1;; + --use-leap-wheels) use_leap_wheels=true; shift 1;; -h) show_help;; -*) echo "unknown option: $1" >&2; exit 1;; @@ -40,6 +33,31 @@ process_arguments() { done } +return_wheelhouse() { + if $use_leap_wheels ; then + WHEELHOUSE=$leap_wheelhouse + elif [ "$WHEELHOUSE" = "" ]; then + WHEELHOUSE=$HOME/wheelhouse + fi + + # Tested with bash and zsh + if [[ $WHEELHOUSE != http* && ! -d "$WHEELHOUSE" ]]; then + mkdir $WHEELHOUSE + fi + + echo "$WHEELHOUSE" +} + +return_install_options() { + wheelhouse=`return_wheelhouse` + install_options="-U --find-links=$wheelhouse" + if $use_leap_wheels ; then + install_options="$install_options --trusted-host lizard.leap.se" + fi + + echo $install_options +} + return_insecure_flags() { for insecure_package in $insecure_packages; do flags="$flags --allow-external $insecure_package --allow-unverified $insecure_package" @@ -59,8 +77,7 @@ return_packages() { } process_arguments $@ -wheelhouse=`return_wheelhouse` -install_options="-U --find-links=$wheelhouse" +install_options=`return_install_options` insecure_flags=`return_insecure_flags` packages=`return_packages` -- cgit v1.2.3