Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
76 changes: 18 additions & 58 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,26 @@ permissions:
contents: write

jobs:
build:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

- name: Install python
uses: actions/setup-python@v4
- name: Setup uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7
with:
python-version: 3.x

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[doc]"

- name: Build docs
run: mkdocs build
- name: Upload static docs
uses: actions/upload-artifact@v3
with:
name: docs
path: site

deploy:
name: Pulish docs if a release was made
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [build]
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install python
uses: actions/setup-python@v4
with:
python-version: 3.x

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[doc]"

- name: Deploy to github pages
run: mkdocs gh-deploy --force
python-version: "3.11"
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
**/.tox/**/*
**/mkdocs.yml

- name: Build HTML documentation with tox
run: uv run mkdocs build

- name: Publish docs if a release was made
if: startsWith(github.ref, 'refs/tags/')
run: uv run mkdocs gh-deploy --force
31 changes: 12 additions & 19 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

- name: Cache pre-commit
uses: actions/cache@v3
- name: Setup uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
python-version: "3.11"
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
**/.tox/**/*
**/.pre-commit-config.yaml

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: Install dependencies
run: |-
python -m pip install pre-commit
pre-commit install

- name: Run pre-commit
run: pre-commit run --all-files --color always
- name: Test with tox
run: uv run -- pre-commit run --all-files --color always --verbose
121 changes: 61 additions & 60 deletions .github/workflows/test_and_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,98 +25,99 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- name: Checkout source
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

# first step checks out the code into
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions

- name: Test with tox
run: tox

# Using Codecov's action, upload the coverage report for the triggering commit/PR
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Setup uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
**/pytest.ini
**/tox.ini

- name: Run tests
run: uv run pytest --cov --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
with:
files: coverage.xml
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

twine_check:
if: "github.repository == 'p-j-smith/mda-tui'"
if: github.repository == 'p-j-smith/mda-tui'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install setuptools twine wheel build

- name: Build package
run: |
python -m build .

- name: Check package build
run: |
DISTRIBUTION=$(ls -t1 dist/mda-tui-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no dist/distribution mda-tui-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION

- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- name: Checkout source
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
with:
fetch-depth: 0
fetch-tags: true


- name: Setup uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7
with:
python-version: "3.11"
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock

- name: Build package
run: uv build

- name: Check package with Twine
run: uv run --with twine twine check dist/*

- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: wheels
path: dist

release-test:
name: Publish to Test PyPI
runs-on: ubuntu-latest
needs: [test, twine_check]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: wheels
path: dist

- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
attestations: false

release:
name: Publish to PyPI
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [release-test]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: wheels
path: dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: false # fail if already exists
attestations: false
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
# pre-commit install-hooks
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.287
rev: v0.14.1
hooks:
- id: ruff
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: Makefile|docs/Makefile|docs/make.bat
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-case-conflict
- id: check-docstring-first
Expand All @@ -28,7 +28,7 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 25.9.0
hooks:
- id: black
exclude: versioneer.py|src/mda_tui/_version.py
47 changes: 16 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,55 +34,40 @@ MDanalysis TUI is alpha software and may change without warning.
## Installation

When installing MDAnalysis TUI, we highly recommend using virtual environments.
If possible, we strongly recommend that you use
[Mambaforge](https://github.com/conda-forge/miniforge#mambaforge) as your package manager.
We recommend that you use
[uv](https://docs.astral.sh/uv/getting-started/installation/) or
[pixi](https://pixi.sh/latest/installation/)
as your package manager.

First ensure that you have [mamba](https://mamba.readthedocs.io/en/latest/index.html) installed.
Assuming you're using `uv`, create and activate a new virtual environment with:

Create a virtual environment and activate it:

```
mamba create --name mda-tui -c conda-forge python=3.10 pip
mamba activate mda-tui
```sh
uv venv --python=3.14
source .venv/bin/activate
```

Then install MDAnalysis TUI:
Then install MDAnalysis TUI with:

```
python -m pip install mda-tui
```

And when you are finished, you can exit the virtual environment with:

```
mamba deactivate
```sh
uv pip install mda_tui
```

To use conda instead, replace all `mamba` commands with `conda`.


### Installation from source

To build MDAnalysis TUI from source, follow the above steps for creating a virtual environment, clone this repository:

```
```sh
git clone https://github.com/p-j-smith/mda-tui.git
```

Then inside your virtual environment type:

```
python -m pip install .
```sh
uv sync
```

If you want to create a development environment, you can
install MDAnalysis TUI in editible mode along with
the dependencies required for running tests and and building docs with
the following command:

```
python -m pip install -e ".[dev]"
```
By default, this will install MDAnalysis TUI in editable mode along with the dependencies
required for development (testing, linting, and building the documentation).

## Code of conduct

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ site_name: MDAnalysis TUI
markdown_extensions:
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- md_in_html
- admonition
Expand Down
Loading
Loading