Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pipenv and pin requirements #757

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
test_python:
docker:
- image: themattrix/tox
- image: cimg/python:3.8
- image: viime/opencpu-base
command: |
/bin/sh -c "chmod a+w /usr/local/lib/R/site-library && service cron start && /usr/lib/rstudio-server/bin/rserver && apachectl -DFOREGROUND"
Expand All @@ -13,12 +13,12 @@ jobs:
command: |
echo "repo=\"girder/viime\"&subdir=\"devops/viime\"&ref=\"${CIRCLE_SHA1}\"&dependencies=NA&upgrade=\"never\"" > input.txt
curl http://localhost:8004/ocpu/library/devtools/R/install_github/ -d "@input.txt"
- run: pip install -U 'tox>=3.7'
# - run: tox -p auto -o
- run: pip install tox
- run: tox -p auto -o

test_web:
docker:
- image: circleci/node:12
- image: cimg/python:3.8-node
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

test_e2e:
docker:
- image: circleci/python:3.6-node-browsers
- image: cimg/python:3.8-browsers
- image: viime/opencpu-base
command: |
/bin/sh -c "chmod a+w /usr/local/lib/R/site-library && service cron start && /usr/lib/rstudio-server/bin/rserver && apachectl -DFOREGROUND"
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:

release:
docker:
- image: node:12
- image: cimg/python:3.8-node
steps:
- checkout
- restore_cache:
Expand All @@ -118,7 +118,6 @@ jobs:
- run:
name: Build python package
command: |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python
pip install tox
tox -e release
- run:
Expand All @@ -131,7 +130,7 @@ jobs:

publish:
docker:
- image: circleci/buildpack-deps:stretch
- image: cimg/base:current
steps:
- checkout
- setup_remote_docker:
Expand All @@ -146,7 +145,7 @@ jobs:

deploy:
docker:
- image: circleci/python:3.6.1
- image: cimg/python:3.8
environment:
AWS_DEFAULT_OUTPUT: json
steps:
Expand Down
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

467 changes: 0 additions & 467 deletions Pipfile.lock

This file was deleted.

16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,9 @@ VIIME

Getting started (Running natively)
----------------------------------

This project includes a `Pipfile` to help set up a virtual environment for
VIIME. To set up the virtual environment

```sh
pipenv install
```

and to enter it

```sh
pipenv shell
```
To install for development:
* [Create and activate a virtual environment](https://docs.python.org/3/tutorial/venv.html)
* Install the dependencies with `pip install -r requirements.txt`

VIIME is configured from a `.env` file present in the current directory where
it is executed. See the included [.env_example](./.env_example) for an example
Expand Down
17 changes: 11 additions & 6 deletions devops/ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
- wheel
state: "latest"
virtualenv: "{{ venv }}"
virtualenv_command: "{{ ansible_python_interpreter }} -m venv"
become: true
become_user: gunicorn

Expand All @@ -73,23 +72,29 @@
name: "gunicorn"
state: "present"
virtualenv: "{{ venv }}"
virtualenv_command: "{{ ansible_python_interpreter }} -m venv"
notify: Restart gunicorn
become: true
become_user: gunicorn

# TODO: It'd probably be better to clone the repo (which is public) and directly install it
# here, rather than depend on an sdist being pre-built by CI.
- name: Copy viime sdist to the remote machine
copy:
src: "{{ viime_sdist_path }}"
dest: "/tmp/viime-sdist.tar.gz"

- name: Copy requirements.txt
copy:
src: "{{ playbook_dir }}/../../requirements.txt"
dest: "/tmp/requirements.txt"

- name: Install viime python package
pip:
name: "/tmp/viime-sdist.tar.gz[memcached,sentry]"
requirements: "/tmp/requirements.txt"
state: "forcereinstall"
extra_args: "--no-cache-dir"
virtualenv: "{{ venv }}"
virtualenv_command: "{{ ansible_python_interpreter }} -m venv"
notify:
- Migrate database
- Restart gunicorn
Expand All @@ -99,9 +104,9 @@

- name: Add gunicorn environment variables
template:
src: "home/gunicorn/.gunicorn_env"
dest: "/home/gunicorn/.env"
mode: 0600
src: "home/gunicorn/.gunicorn_env"
dest: "/home/gunicorn/.env"
mode: 0600
become: true
become_user: gunicorn

Expand Down
53 changes: 53 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
alembic==1.5.6
blinker==1.4
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
cycler==0.10.0
decorator==4.4.2
dogpile.cache==1.1.2
et-xmlfile==1.0.1
Flask==1.1.2
Flask-Cors==3.0.10
Flask-Migrate==2.7.0
Flask-SQLAlchemy==2.4.4
gunicorn==19.9.0
idna==2.10
importlib-metadata==3.7.2
itsdangerous==1.1.0
Jinja2==2.11.3
joblib==1.0.1
kiwisolver==1.3.1
Mako==1.1.4
MarkupSafe==1.1.1
marshmallow==3.10.0
matplotlib==3.3.4
numpy==1.19.5
openpyxl==3.0.7
packaging==20.4
pandas==1.1.5
pbr==5.5.1
Pillow==8.1.2
pylibmc==1.6.1
pyparsing==2.4.7
python-dateutil==2.8.1
python-dotenv==0.15.0
python-editor==1.0.4
pytz==2021.1
requests==2.25.1
scikit-learn==0.24.1
scipy==1.5.4
sentry-sdk==1.0.0
six==1.15.0
sklearn==0.0
SQLAlchemy==1.3.23
SQLAlchemy-Utils==0.36.8
stevedore==3.3.0
threadpoolctl==2.1.0
typing-extensions==3.7.4.3
urllib3==1.26.3
viime==1.0.1
webargs==5.5.3
Werkzeug==1.0.1
xlrd==1.2.0
zipp==3.4.1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def list_files_recursive(relpath):
author_email='[email protected]',
packages=find_packages(include=['viime']),
include_package_data=True,
python_requires='>=3.8',
install_requires=[
'alembic',
'dogpile.cache',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_excel_file_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_upload_excel_file(client):

assert resp.status_code == 201
res = resp.json
assert type(res) == list
assert type(res) is list
assert len(res) == 2

sheet1 = res[0]
Expand Down
22 changes: 12 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
[tox]
envlist = py3{6,7,8}, lint
skip_missing_interpreters = true
envlist = py38, lint
basepython = python3.8

[testenv]
deps = httmock
pytest
pytest-cov
deps =
-r requirements.txt
httmock
pytest
pytest-cov
commands = pytest {posargs} tests
usedevelop = true

[testenv:lint]
deps = flake8
flake8-import-order
flake8-quotes
pep8-naming
deps =
flake8
flake8-import-order
flake8-quotes
pep8-naming
commands = flake8 {posargs} setup.py tests viime

[testenv:release]
skip_install = true
skipsdist = true
basepython = python2.7
commands = python setup.py sdist

[testenv:mypy]
Expand Down
2 changes: 1 addition & 1 deletion viime/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from werkzeug.datastructures import FileStorage

from viime import opencpu, samples
from viime.analyses import anova_test, factor_analysis, hierarchical_clustering,\
from viime.analyses import anova_test, factor_analysis, hierarchical_clustering, \
oplsda, pairwise_correlation, plsda, roc_analysis, wilcoxon_test
from viime.imputation import IMPUTE_MCAR_METHODS, IMPUTE_MNAR_METHODS
from viime.models import AXIS_NAME_TYPES, clean, CSVFile, CSVFileSchema, db, \
Expand Down