Skip to content

Commit

Permalink
#87 remove version pins for markupsafe, flask and werkzeug
Browse files Browse the repository at this point in the history
also remove dependency on flask-api
  • Loading branch information
Alok Saldanha authored and Alok Saldanha committed Mar 10, 2024
1 parent 6a2bc40 commit 5d29153
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 20 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
conda env create -f environment.yml
eval "$(conda shell.bash hook)"
conda activate cellxgene-gateway
pip install markupsafe==2.0.1 # temporary workaround for jinja2-2.11.3 calling soft_unicode in markupsafe
python setup.py install
- name: Run tests
Expand Down
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# UNRELEASED

* Removed dependency on flask-api enabling update of werkzeug
* Updated dependencies (python 3.11, numpy 1.26, unpinned flask, werkzeug)

# 0.3.12

* #81 List gene set annotations when cell annotations not present
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.9
FROM python:3.11

RUN pip install --upgrade pip \
&& pip install cellxgene-gateway 'MarkupSafe<2.1'
RUN pip install --upgrade pip
RUN pip install "cellxgene-gateway>=0.4"

ENV CELLXGENE_DATA=/cellxgene-data
ENV CELLXGENE_LOCATION=/usr/local/bin/cellxgene
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Additional environment variables can be provided with the `-e` parameter:

```bash
docker run -it --rm \
-v <local_data_dir>:/cellxgene-data \
-v ../cellxgene_data:/cellxgene-data \
-e GATEWAY_PORT=8080 \
-p 8080:8080 \
cellxgene-gateway
Expand Down Expand Up @@ -191,6 +191,35 @@ black .

If you need help for any reason, please make a github ticket. One of the contributors should help you out.

# Releasing New Versions

## How to prepare for release

- Update Changelog.md and version number in __init__.py
- Cut a release on github
- Go to your project homepage on GitHub
- On right side, you will see [Releases](https://github.com/Novartis/cellxgene-gateway/releases) link. Click on it.
- Click on Draft a new release
- Fill in all the details
- Tag version should be the version number of your package release
- Release Title can be anything you want, but we use v0.3.11 (the same as the tag to be created on publish)
- Description should be changelog
- Click Publish release at the bottom of the page
- Now under Releases you can view all of your releases.
- Copy the download link (tar.gz) and save it somewhere

## How to publish to PyPI

Make sure your `.pypirc` is set up for testpypi and pypi index servers.


```bash
rm -rf dist
python setup.py sdist bdist_wheel
python -m twine upload --repository testpypi dist/*
python -m twine upload dist/*
```

# Contributors

* Niket Patel - https://github.com/NiketPatel9
Expand Down
6 changes: 3 additions & 3 deletions cellxgene_gateway/backend_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from threading import Thread
from typing import List

from flask_api import status
from http import HTTPStatus

from cellxgene_gateway import env
from cellxgene_gateway.cache_entry import CacheEntry, CacheEntryStatus
Expand Down Expand Up @@ -53,7 +53,7 @@ def check_path(self, source, path):
return matches[0]
else:
raise CellxgeneException(
status.HTTP_500_INTERNAL_SERVER_ERROR,
HTTPStatus.INTERNAL_SERVER_ERROR,
"Found " + str(len(matches)) + " for " + path,
)

Expand All @@ -71,7 +71,7 @@ def check_entry(self, key):
return matches[0]
else:
raise CellxgeneException(
status.HTTP_500_INTERNAL_SERVER_ERROR,
HTTPStatus.INTERNAL_SERVER_ERROR,
"Found " + str(len(matches)) + " for " + key.dataset,
)

Expand Down
2 changes: 0 additions & 2 deletions cellxgene_gateway/dir_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

import os

from flask_api import status

from cellxgene_gateway import env
from cellxgene_gateway.cellxgene_exception import CellxgeneException

Expand Down
6 changes: 3 additions & 3 deletions cellxgene_gateway/subprocess_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import logging
import subprocess

from flask_api import status
from http import HTTPStatus

from cellxgene_gateway.cache_entry import CacheEntryStatus
from cellxgene_gateway.dir_util import make_annotations
Expand Down Expand Up @@ -76,10 +76,10 @@ def launch(self, cellxgene_loc, scripts, cache_entry):
or "Could not open file" in stderr
):
message = "File was invalid."
http_status = status.HTTP_400_BAD_REQUEST
http_status = HTTPStatus.BAD_REQUEST
else:
message = "Cellxgene failed to launch dataset."
http_status = status.HTTP_500_INTERNAL_SERVER_ERROR
http_status = HTTPStatus.INTERNAL_SERVER_ERROR

cache_entry.status = CacheEntryStatus.error
cache_entry.set_error(message, stderr, http_status)
Expand Down
7 changes: 3 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: cellxgene-gateway
channels:
- conda-forge
dependencies:
- python=3.9
- python=3.11
- requests
- flask==2.2.5
- flask
- psutil
- black
- twine
Expand All @@ -13,6 +13,5 @@ dependencies:
- pip
- pip:
- pre_commit
- flask-api
- werkzeug==2.3.8
- werkzeug
- cellxgene
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cellxgene
flask==2.2.5
flask-api
werkzeug==2.3.8
flask
werkzeug
psutil
requests

0 comments on commit 5d29153

Please sign in to comment.