Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Clinical-Genomics/cg into remove-…
Browse files Browse the repository at this point in the history
…concatenation-balsamic
  • Loading branch information
ivadym committed Oct 30, 2023
2 parents 76007f0 + 27d8619 commit f2e23ff
Show file tree
Hide file tree
Showing 15 changed files with 2,536 additions and 188 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[bumpversion]
current_version = 51.9.6
current_version = 51.9.7
commit = True
tag = True
tag_name = v{new_version}
message = Bump version: {current_version} → {new_version} [skip ci]

[bumpversion:file:setup.py]
[bumpversion:file:pyproject.toml]

[bumpversion:file:cg/__init__.py]
31 changes: 12 additions & 19 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,16 @@ jobs:
with:
python-version: "3.11"

- name: Install build tools
run: >-
python -m
pip install
wheel
twine
--user
- name: Build a binary wheel and a source tarball
run: >-
python
setup.py
sdist
bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
virtualenvs-create: false

- name: Build and Publish Distribution to PyPI 📦
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.pypi_password }}
run: |
poetry publish --no-interaction --build \
--username $PYPI_USERNAME \
--password $PYPI_PASSWORD
15 changes: 7 additions & 8 deletions .github/workflows/installations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@ jobs:
with:
python-version: ${{ matrix.python-version}}

- name: Install and Upgrade Pip
run: |
python -m pip install --upgrade pip
echo ${{ matrix.python-version}}
pip --version
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false

- name: Cache Dependencies
uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/requirements*.txt') }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements.txt -r requirements-dev.txt
pip check
poetry install --no-interaction
poetry check
11 changes: 7 additions & 4 deletions .github/workflows/tests_and_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ jobs:
with:
python-version: "3.11"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false

- name: Cache dependencies
uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/requirements*.txt') }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
run: poetry install --no-interaction

- name: Test with pytest & Coveralls
run: |
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com

First of all, make sure that you are managing your python versions that are used on your machine, [never use the OS native python](https://docs.python-guide.org/starting/installation/). Suggested ways to handle python version are either through [homebrew](https://brew.sh/#install)(OSX), [pyenv](https://github.com/pyenv/pyenv) or [conda](https://docs.anaconda.com/anaconda/install/).

For local development, it is recommended to use Poetry. Ensure that you have Poetry installed and run
```bash
poetry install
```

On our servers where the production and stage versions of CG are run the packages are maintained by using conda environments. For local development it is suggested to follow the [python packaging guidelines](https://packaging.python.org/tutorials/managing-dependencies/) where it is suggested to manage your local python environment with [pipenv](https://pipenv.pypa.io/en/latest/). CG has a Pipfile.lock file which will ensure that the installation will work if the environment is set up in the correct way. To use a **combination of conda and pipenv** make sure that you point to the conda installation of python when creating your pipenv virtual environment (`pipenv --python=$(conda run which python) --site-packages`) more about that [here](https://pipenv.pypa.io/en/latest/advanced/#pipenv-and-other-python-distributions) and in [this](https://stackoverflow.com/questions/50546339/pipenv-with-conda) stack overflow thread. (It is not necessary to use conda on for local development)

Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ ENV GOOGLE_OAUTH_CLIENT_SECRET="1"


WORKDIR /home/src/app
COPY cg ./cg
COPY templates ./templates
COPY MANIFEST.in pyproject.toml requirements* setup.py ./
COPY pyproject.toml poetry.lock ./

RUN pip install --no-cache-dir poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

RUN pip install -r requirements.txt
RUN pip install -e .
COPY cg ./cg
COPY templates ./templates

CMD gunicorn \
--workers=$GUNICORN_WORKERS \
Expand Down
12 changes: 9 additions & 3 deletions Dockerfile-cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ RUN addgroup --system nonroot \
&& adduser --system --ingroup nonroot nonroot

WORKDIR /app
COPY . /app/

RUN pip install .
RUN pip install --no-cache-dir poetry

COPY pyproject.toml poetry.lock /app/

RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi

COPY . /app/

USER nonroot
USER nonroot
12 changes: 0 additions & 12 deletions MANIFEST.in

This file was deleted.

15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,18 @@ Please check out our [guide for contributing to cg](CONTRIBUTING.md)

## Installation

Cg written in Python 3.6+ and is available on the [Python Package Index][pypi] (PyPI).
Cg written in Python 3.9+ and is available on the [Python Package Index][pypi] (PyPI).

```bash
pip install cg
```

If you would like to install the latest development version:
If you would like to install the latest development version, use [poetry](https://python-poetry.org/docs/).

```bash
git clone https://github.com/Clinical-Genomics/cg
cd cg
```
To install CG either use pipenv (as described in contributing) and run
```bash
pipenv install -e .
```

or (without pipenv)

```bash
pip install -r requirements-dev.txt --editable .
poetry install
```


Expand Down
4 changes: 1 addition & 3 deletions cg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import pkg_resources

__title__ = "cg"
__version__ = "51.9.6"
__version__ = "51.9.7"
Loading

0 comments on commit f2e23ff

Please sign in to comment.