Skip to content

Commit

Permalink
Merge pull request #71 from irgolic/cleanup-pjt-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xinaesthete authored Apr 15, 2024
2 parents 5030fc5 + e1fff0f commit 751a956
Show file tree
Hide file tree
Showing 27 changed files with 5,141 additions and 1,595 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add commit hashes here for ignored commits

f93a09e0378b55a47faebf5690cb036aab4e99a2
7f4bd896704515f9ee9516db6c6863506c31be7e
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI
on:
push:
branches:
# FIXME replace this with main after merge to main
- pjt-dev
# - main
pull_request:
branches:
# FIXME replace this with main after merge to main
- pjt-dev
# - main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pytest:
defaults:
run:
working-directory: python
strategy:
matrix:
python-version: [ 3.12 ]
poetry-version: [ 1.7.1 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- run: poetry install --with dev
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH

- run: make test

pyright:
defaults:
run:
working-directory: python
strategy:
matrix:
python-version: [3.12]
pyright-version: [1.1.343]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- run: poetry install --with dev
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH

- uses: jakebailey/pyright-action@v1
with:
version: ${{ matrix.pyright-version }}

ruff:
defaults:
run:
working-directory: python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
with:
args: "check"
- uses: chartboost/ruff-action@v1
with:
args: "format --check"
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ python/mdvtools/static/*
python/mdvtools/template/page.html
.ipynb_checkpoints

python/requirements.txt
python/dist/
docs/jsdocs/build/
docs/maindocs/_build/
docs/maindocs/autoapi/

venv/
data/
data/

.idea
xvenv/
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/MDV.iml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ https://myserver.com/path/to/myapp
* clone the repository
* npm install

### Git blame without formatting commits

The `.git-blame-ignore-revs` file is used to ignore commits when running `git blame`. This is useful for ignoring formatting commits when trying to find the original author of a line of code. To use it, run:

```bash
git config -e
```

And add the following lines:

```toml
[blame]
ignoreRevsFile = ".git-blame-ignore-revs"
markIgnoredLines = true
```

Mark ignored lines will prepend a `?` to the blame commit hashes for indirectly blamed lines.

### note - this documentation is somewhat deprecated - [for dev-branch](#dev-branch)

You can run a project in development mode, which allows you do debug the JavaScript code and make changes, which will be reflected in the browser.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"build-docs": "sphinx-build -M html docs/maindocs docs/maindocs/_build",
"build-docs-nix": "source venv/bin/activate && npm run build-docs",
"build-jsdocs": "jsdoc -c docs/jsdocs/jsdoc.json",
"python-setup": "python -m venv venv && source venv/bin/activate && pip install -e python && npm run build-flask-vite",
"poetry-setup": "curl -sSL https://install.python-poetry.org | python3 -",
"python-setup": "python -m venv venv && source venv/bin/activate && cd python && poetry install --with dev && npm run build-flask-vite",
"mdv_desktop": "source venv/bin/activate && python -m mdvtools.mdv_desktop",
"fix_npm_win": "npm config set script-shell \"cmd\""
},
Expand Down
13 changes: 13 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
test:
poetry run pytest

type:
poetry run pyright

format:
poetry run ruff format .

lint:
poetry run ruff check . --fix

all: format lint type test
31 changes: 26 additions & 5 deletions python/readme.md → python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

## Installation

### Make virtual environment

It is recommended, but not essential to create a virtual environment so there are no conflicts with modules in the global python.

To create and activate an environment in linux:-
Expand All @@ -16,13 +18,30 @@ python -m venv c:\path\to\myenv
c:\path\to\myenv\Scripts\activate.bat
```
Installing mdv (with -e if for development) will include dependencies:
### Install poetry
Install poetry if it is not already installed. This can be done with the official installer:
```
cd MDV/python
pip install -e .
curl -sSL https://install.python-poetry.org | python3 -
```
Or with pipx:
```
pip install pipx
pipx install poetry
```
See the [poetry installation instructions](https://python-poetry.org/docs/#installing-with-pipx) for more details and troubleshooting.
### Install MDV
To install MDV, run:
```
cd MDV/python
poetry install --with dev
```
## Quick Start
Expand All @@ -33,9 +52,11 @@ To make an empty project, just create an MDVProject object specifying a path. Da
```python
from mdvtools.mdvproject import MDVProject
p=MDVProject("/path/to/myproject")
p = MDVProject("/path/to/myproject")
df = pd.read_csv("cells.tsv", sep="\t")
p.add_datasource("cells", df) #or p.add_datasource("cells", "cells.tsv")
p.add_datasource("cells", df) # or p.add_datasource("cells", "cells.tsv")
```

Initially an empty default view is created. The easiest way to add content is interactively through the browser. To do this, make the project editable and then serve it:-
Expand Down
Loading

0 comments on commit 751a956

Please sign in to comment.