Skip to content

Commit

Permalink
Merge pull request #735 from datavisyn/release-15.0.0
Browse files Browse the repository at this point in the history
Release 15.0.0
  • Loading branch information
Anita Steiner authored Jun 15, 2022
2 parents 3ce118d + 496b64b commit 829cdc6
Show file tree
Hide file tree
Showing 357 changed files with 7,721 additions and 4,786 deletions.
53 changes: 23 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ executors:
python-executor:
working_directory: ~/phovea-python
docker:
- image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
- image: circleci/python:3.10-buster
node-executor:
working_directory: ~/phovea-web
docker:
Expand All @@ -15,52 +15,45 @@ jobs:
executor: python-executor
steps:
- checkout
- run:
name: Show Node.js and npm version
command: |
node -v
npm -v
- run:
name: Show Python and pip version
command: |
python --version
pip --version
- run:
name: Install Docker packages from docker_packages.txt
command: |
(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
- restore_cache:
key: deps2-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
key: deps-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
- run:
name: Install pip requirements
command: |
virtualenv ~/venv
. ~/venv/bin/activate
pip install -r requirements_dev.txt
pip install -r requirements.txt
make develop
- save_cache:
key: deps2-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
key: deps-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
paths:
- ~/venv
- run:
name: Force an update of pip dependencies from git repositories # not sure if this is working ?
command: |
. ~/venv/bin/activate
pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
pip install --upgrade --upgrade-strategy=only-if-needed -e .[develop]
- run:
name: Show installed pip packages
command: pip list || true
command: |
. ~/venv/bin/activate
pip list || true
- run:
name: Remove all from dist folder
name: Linting
command: |
rm -rf dist && mkdir dist
. ~/venv/bin/activate
make lint check-format
- run:
name: Build
name: Run tests
command: |
. ~/venv/bin/activate
npm run dist:python
make test
- run:
name: Build wheel
command: |
. ~/venv/bin/activate
make build
- store_artifacts:
path: dist
path: dist_python
destination: dist-python
- persist_to_workspace:
root: ~/.
Expand Down Expand Up @@ -88,7 +81,7 @@ jobs:
name: Publish package
command: |
. ~/venv/bin/activate
twine upload dist/*
twine upload dist_python/*
web-build:
executor: node-executor
steps:
Expand All @@ -99,7 +92,7 @@ jobs:
node -v
npm -v
- restore_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: Install npm dependencies
command: npm install
Expand All @@ -108,7 +101,7 @@ jobs:
command: |
(grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf
- save_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
paths: ./node_modules
- run:
name: Install npm dependencies from git repositories (always get latest commit)
Expand All @@ -118,7 +111,7 @@ jobs:
command: npm list --depth=1 || true
- run:
name: Build
command: npm run dist:web
command: npm run dist
- store_artifacts:
path: dist
destination: dist-web
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/build/
/storybook-static/
/dist/tsBuildInfoFile
/dist_python/
/lib/
*.egg-info/
*.egg
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include tdp_core *
58 changes: 58 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.DEFAULT_GOAL := help
pkg_src = tdp_core

flake8 = flake8 $(pkg_src) setup.py
isort = isort $(pkg_src) setup.py
black = black --line-length 140 $(pkg_src) setup.py

.PHONY: all ## Perform the most common development-time rules
all: format lint test

.PHONY: ci ## Run all CI validation steps without making any changes to code
ci: check-format lint test

.PHONY: format ## Auto-format the source code
format:
$(isort)
$(black)

.PHONY: check-format ## Check the source code format without changes
check-format:
$(isort) --check-only
$(black) --check

.PHONY: lint ## Run flake8
lint:
$(flake8)

.PHONY: test ## Run tests
test:
pytest $(pkg_src)

.PHONEY: documentation ## Generate docs
documentation:
mkdocs build

.PHONY: install ## Install the requirements
install:
pip install -e .

.PHONY: develop ## Set up the development environment
develop:
pip install -e .[develop]

.PHONY: build ## Build a wheel
build:
python setup.py sdist bdist_wheel --dist-dir dist_python

.PHONY: publish ## Publish the ./dist/* using twine
publish:
pip install twine==3.8.0
twine upload --repository-url https://upload.pypi.org/legacy/ dist_python/*

.PHONY: help ## Display this message
help:
@grep -E \
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-20s\033[0m %s\n", $$2, $$3}'
69 changes: 0 additions & 69 deletions buildPython.js

This file was deleted.

19 changes: 19 additions & 0 deletions deploy/Dockerfile_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.10-buster

LABEL maintainer="[email protected]"
WORKDIR /phovea

COPY requirements*.txt ./
RUN (apt-get update) && \
(pip install --no-cache-dir -r requirements.txt) && \
(pip install --no-cache-dir -r requirements_dev.txt)

# Create entrypoint installing the volume-mounted workspace repos
RUN echo '#!/bin/sh\npip install --no-cache-dir --no-deps -r /phovea/requirements_workspace.txt\n$@' > /tmp/entrypoint.sh
RUN chmod +x /tmp/entrypoint.sh
ENTRYPOINT [ "/tmp/entrypoint.sh" ]

# Default command is to start the server
CMD [ "python -m uvicorn tdp_core.server.main:app --reload --host 0.0.0.0 --port 9000" ]

EXPOSE 9000
5 changes: 4 additions & 1 deletion deploy/docker-compose-debug.partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ version: '2.0'
services:
db_mongo:
ports:
- '27017:27017'
- '27017:27017'
api:
# Override the default server command to add a debugging process. This causes the app to run slower, therefore it is optional.
command: 'python -m debugpy --listen 0.0.0.0:5678 -m uvicorn tdp_core.server.main:app --reload --host 0.0.0.0 --port 9000'
20 changes: 20 additions & 0 deletions deploy/docker-compose.partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ services:
- db_mongo
links:
- db_mongo:mongo
api:
build:
context: .
dockerfile: deploy/Dockerfile_dev
args:
- http_proxy
- HTTP_PROXY
- https_proxy
- HTTPS_PROXY
- no_proxy
- NO_PROXY
ports:
- '9000:9000'
# Required port for the python debugger
- '5678:5678'
volumes:
- .:/phovea
environment:
- ENV=development
- PYTHONUNBUFFERED=1
db_mongo:
image: mongo:3.2
volumes:
Expand Down
2 changes: 1 addition & 1 deletion dist/base/ErrorAlertHandler.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions dist/base/ErrorAlertHandler.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/base/ErrorAlertHandler.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/base/LoginMenu.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/base/LoginMenu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 829cdc6

Please sign in to comment.