From babcf7d25b6d64de031077b60c8cb7a5e9ebea67 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 12 Nov 2019 16:07:19 +0530 Subject: [PATCH 1/6] chore: trimmed requirements by pipreqs --- requirements.txt | 130 ++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 68 deletions(-) diff --git a/requirements.txt b/requirements.txt index 84788c863e..41f2a405e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,68 +1,62 @@ -boto3 -chardet -dropbox==9.1.0 -gunicorn -jinja2 -markdown2==2.3.5 -PyMySQL -maxminddb-geolite2 -python-dateutil -pytz -six -werkzeug -semantic_version -rauth>=0.6.2 -requests -redis==2.10.6 -selenium -babel==2.6.0 -ipython -html2text==2016.9.19 -email_reply_parser -click==7.0 -num2words==0.5.5 -watchdog==0.8.0 -bleach==2.1.4 -bleach-whitelist -Pillow -beautifulsoup4 -rq==0.12.0 -schedule -cryptography -pyopenssl -ndg-httpsclient -pyasn1 -zxcvbn-python -unittest-xml-reporting -oauthlib -requests-oauthlib -pdfkit -PyJWT -PyPDF2 -openpyxl -pyotp -pyqrcode -pypng -premailer -croniter -googlemaps==3.1.1 -braintree -future -passlib -google-api-python-client -google-auth -google-auth-httplib2 -google-auth-oauthlib -faker -stripe -coverage -urllib3 -GitPython==2.1.11 -psycopg2==2.7.5 -psycopg2-binary==2.7.5 -sqlparse==0.2.4 -Pygments==2.2.0 -frontmatter -PyYAML==3.13 -xlrd -RestrictedPython==5.0 \ No newline at end of file +setuptools==40.8.0 +urllib3==1.25.6 +Jinja2==2.10.3 +semantic_version==2.8.2 +pip==19.2.3 +chardet==3.0.4 +Click==7.0 +six==1.12.0 +requests==2.22.0 +ipython==7.9.0 +Image==1.5.27 +Pillow==6.2.1 +PyPDF2==1.26.0 +RestrictedPython==5.0 +google_api_python_client==1.7.11 +Babel==2.7.0 +bleach==3.1.0 +bleach_whitelist==0.0.10 +boto3==1.10.15 +botocore==1.13.15 +braintree==3.57.1 +beautifulsoup4==4.8.1 +coverage==4.5.4 +croniter==0.3.30 +cryptography==2.8 +pycups==1.9.74 +python_dateutil==2.8.1 +dropbox==9.4.0 +email_reply_parser==0.5.9 +Faker==2.0.3 +python_frontmatter==0.4.5 +protobuf==3.10.0 +html2text==2019.9.26 +PyJWT==1.7.1 +python_ldap==3.2.0 +ldap3==2.6.1 +markdown2==2.3.8 +num2words==0.5.10 +oauthlib==3.1.0 +openpyxl==3.0.0 +passlib==1.7.1 +future==0.18.2 +pdfkit==0.6.1 +premailer==3.6.1 +psycopg2==2.8.4 +Pygments==2.4.2 +pymysql==0.9.3 +pyotp==2.3.0 +pyqrcode==1.2.1 +pytz==2019.3 +rauth==0.7.3 +redis==3.3.11 +rq==1.1.0 +schedule==0.6.0 +selenium==3.141.0 +sqlparse==0.3.0 +stripe==2.40.0 +watchdog==0.9.0 +Werkzeug==0.16.0 +xlrd==1.2.0 +xmlrunner==1.7.7 +zxcvbn==4.4.28 From 355c5fb3709aec446adf57571dd4a542fa269499 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 12 Nov 2019 19:05:08 +0530 Subject: [PATCH 2/6] fix: add cups dependency perf: conditional config for database --- .travis.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index df66db88a7..ffd05eae03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,16 @@ matrix: env: DB=mariadb TYPE=server script: bench --site test_site run-tests --coverage +before_install: + # install wkhtmltopdf + - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz + - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp + - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf + - sudo chmod o+x /usr/local/bin/wkhtmltopdf + + # install cups + - sudo apt-get install libcups2-dev + install: - cd ~ - source ./.nvm/nvm.sh @@ -52,23 +62,20 @@ install: - mkdir ~/frappe-bench/sites/test_site - cp $TRAVIS_BUILD_DIR/.travis/$DB.json ~/frappe-bench/sites/test_site/site_config.json - - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'" - - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" + - if: env(DB) = "mariadb" + - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'" + - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" - - mysql -u root -e "CREATE DATABASE test_frappe" - - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" - - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" + - mysql -u root -e "CREATE DATABASE test_frappe" + - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" + - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" - - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'" - - mysql -u root -e "FLUSH PRIVILEGES" + - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'" + - mysql -u root -e "FLUSH PRIVILEGES" - - psql -c "CREATE DATABASE test_frappe" -U postgres - - psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres - - - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz - - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp - - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf - - sudo chmod o+x /usr/local/bin/wkhtmltopdf + - if: env(DB) = "postgres" + - psql -c "CREATE DATABASE test_frappe" -U postgres + - psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres - cd ./frappe-bench From a3b100daaeaaf3336ea521c5759d89b447f039f3 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 15 Nov 2019 11:23:12 +0530 Subject: [PATCH 3/6] chore: manual requirements.txt generation --- requirements.txt | 99 +++++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/requirements.txt b/requirements.txt index 41f2a405e0..5d961b90c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,62 +1,67 @@ -setuptools==40.8.0 -urllib3==1.25.6 -Jinja2==2.10.3 -semantic_version==2.8.2 -pip==19.2.3 +Babel==2.6.0 +beautifulsoup4==4.8.1 +bleach-whitelist==0.0.10 +bleach==2.1.4 +boto3==1.10.18 +braintree==3.57.1 chardet==3.0.4 Click==7.0 -six==1.12.0 -requests==2.22.0 -ipython==7.9.0 -Image==1.5.27 -Pillow==6.2.1 -PyPDF2==1.26.0 -RestrictedPython==5.0 -google_api_python_client==1.7.11 -Babel==2.7.0 -bleach==3.1.0 -bleach_whitelist==0.0.10 -boto3==1.10.15 -botocore==1.13.15 -braintree==3.57.1 -beautifulsoup4==4.8.1 coverage==4.5.4 croniter==0.3.30 cryptography==2.8 -pycups==1.9.74 -python_dateutil==2.8.1 -dropbox==9.4.0 -email_reply_parser==0.5.9 -Faker==2.0.3 -python_frontmatter==0.4.5 -protobuf==3.10.0 -html2text==2019.9.26 -PyJWT==1.7.1 -python_ldap==3.2.0 -ldap3==2.6.1 -markdown2==2.3.8 -num2words==0.5.10 -oauthlib==3.1.0 -openpyxl==3.0.0 -passlib==1.7.1 +dropbox==9.1.0 +email-reply-parser==0.5.9 +Faker==2.0.4 +frontmatter==3.0.5 future==0.18.2 +GitPython==2.1.11 +google-api-python-client==1.7.11 +google-auth-httplib2==0.0.3 +google-auth-oauthlib==0.4.1 +google-auth==1.7.1 +googlemaps==3.1.1 +gunicorn==20.0.0 +html2text==2016.9.19 +ipython==7.9.0 +Jinja2==2.10.3 +markdown2==2.3.5 +maxminddb-geolite2==2018.703 +ndg-httpsclient==0.5.1 +num2words==0.5.5 +oauthlib==3.1.0 +openpyxl==3.0.1 +passlib==1.7.1 pdfkit==0.6.1 +Pillow==6.2.1 premailer==3.6.1 -psycopg2==2.8.4 -Pygments==2.4.2 -pymysql==0.9.3 +psycopg2-binary==2.7.5 +psycopg2==2.7.5 +pyasn1==0.4.7 +Pygments==2.2.0 +PyJWT==1.7.1 +PyMySQL==0.9.3 +pyOpenSSL==19.0.0 pyotp==2.3.0 -pyqrcode==1.2.1 +PyPDF2==1.26.0 +pypng==0.0.20 +PyQRCode==1.2.1 +python-dateutil==2.8.1 pytz==2019.3 +PyYAML==3.13 rauth==0.7.3 -redis==3.3.11 -rq==1.1.0 +redis==2.10.6 +requests-oauthlib==1.3.0 +requests==2.22.0 +RestrictedPython==5.0 +rq==0.12.0 schedule==0.6.0 -selenium==3.141.0 -sqlparse==0.3.0 +semantic-version==2.8.2 +six==1.13.0 +sqlparse==0.2.4 stripe==2.40.0 -watchdog==0.9.0 +unittest-xml-reporting==2.5.2 +urllib3==1.25.7 +watchdog==0.8.0 Werkzeug==0.16.0 xlrd==1.2.0 -xmlrunner==1.7.7 -zxcvbn==4.4.28 +zxcvbn-python==4.4.24 From e55135f216ff80894a05a7cc837c2fc82ac846e7 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 15 Nov 2019 13:37:50 +0530 Subject: [PATCH 4/6] fix: updated travis config --- .travis.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index ffd05eae03..6990a0df8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python dist: trusty -sudo: required addons: hosts: @@ -62,20 +61,20 @@ install: - mkdir ~/frappe-bench/sites/test_site - cp $TRAVIS_BUILD_DIR/.travis/$DB.json ~/frappe-bench/sites/test_site/site_config.json - - if: env(DB) = "mariadb" - - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'" - - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" + - if [ $DB == "mariadb" ];then + mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"; + mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"; + mysql -u root -e "CREATE DATABASE test_frappe"; + mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"; + mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"; + mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"; + mysql -u root -e "FLUSH PRIVILEGES"; + fi - - mysql -u root -e "CREATE DATABASE test_frappe" - - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" - - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" - - - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'" - - mysql -u root -e "FLUSH PRIVILEGES" - - - if: env(DB) = "postgres" - - psql -c "CREATE DATABASE test_frappe" -U postgres - - psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres + - if [ $DB == "postgres" ];then + psql -c "CREATE DATABASE test_frappe" -U postgres; + psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres; + fi - cd ./frappe-bench From 6cb2a9c2ee65673bde193d23baa63b311321c048 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 15 Nov 2019 13:45:33 +0530 Subject: [PATCH 5/6] chore: added selenium requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 5d961b90c8..dd68094ca5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -55,6 +55,7 @@ requests==2.22.0 RestrictedPython==5.0 rq==0.12.0 schedule==0.6.0 +selenium==3.141.0 semantic-version==2.8.2 six==1.13.0 sqlparse==0.2.4 From aa217e3b46a47be7ce9e0f5ac9ce8f9490b1f38d Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 15 Nov 2019 14:31:01 +0530 Subject: [PATCH 6/6] fix(compat): pin requirements for backwards compatibility gunicorn==19.9.0 ipython==5.8.0 openpyxl==2.6.4 to update these packages, will have to drop support for py2 --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index dd68094ca5..dcfaac89ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,16 +20,16 @@ google-auth-httplib2==0.0.3 google-auth-oauthlib==0.4.1 google-auth==1.7.1 googlemaps==3.1.1 -gunicorn==20.0.0 +gunicorn==19.9.0 html2text==2016.9.19 -ipython==7.9.0 +ipython==5.8.0 Jinja2==2.10.3 markdown2==2.3.5 maxminddb-geolite2==2018.703 ndg-httpsclient==0.5.1 num2words==0.5.5 oauthlib==3.1.0 -openpyxl==3.0.1 +openpyxl==2.6.4 passlib==1.7.1 pdfkit==0.6.1 Pillow==6.2.1