Skip to content

Commit

Permalink
uv upgrade (#779)
Browse files Browse the repository at this point in the history
* migrate to uv

* remove TODO (won't work)

* update tests

* bump znh5md
  • Loading branch information
PythonFZ authored Feb 7, 2025
1 parent 4d1147e commit a93e874
Show file tree
Hide file tree
Showing 7 changed files with 3,990 additions and 5,805 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
name: Publish Docker image

on:
# push:
# branches:
# - dev
release:
types: [published]

Expand Down Expand Up @@ -49,11 +46,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: build frontend
run: |
npm install -g bun
Expand All @@ -62,5 +56,5 @@ jobs:
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
uv build
uv publish --token $PYPI_TOKEN
24 changes: 7 additions & 17 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
Expand All @@ -37,29 +38,18 @@ jobs:

steps:
- uses: actions/checkout@v4
# - uses: oven-sh/setup-bun@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# - name: bun build install
# run: |
# cd app
# bun install
# bun vite build
- name: Install package
run: |
poetry install --no-interaction
uv sync --all-extras --dev
- name: Pytest
run: |
poetry run python --version
poetry run coverage run -m pytest -vv
poetry run coverage xml
uv run python --version
uv run coverage run -m pytest -vv
uv run coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
5,725 changes: 0 additions & 5,725 deletions poetry.lock

This file was deleted.

108 changes: 56 additions & 52 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,65 +1,52 @@
[tool.poetry]
[project]
name = "zndraw"
version = "0.5.8"
version = "0.5.8a1"
description = "Display and Edit Molecular Structures and Trajectories in the Browser."
authors = ["zincwarecode <[email protected]>"]
license = "License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)"
authors = [
{ name = "Fabian Zills", email = "[email protected]" },
]
classifiers = ["License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)"]
readme = "README.md"
include = ["zndraw/templates/**/*", "zndraw_app/**/*"]

[tool.poetry.dependencies]
python = "^3.10"
ase = "^3"
typer = {extras = ["all"], version = "^0.13"}
flask = "^3"
tqdm = "^4"
flask-socketio = "^5"
networkx = "^3"
pydantic = "^2"
python-socketio = {extras = ["client"], version = "^5.11"}
plotly = "^5"
pandas = "^2"
celery = "^5"
sqlalchemy = "^2"
redis = "^5"
splines = "^0.3"
znsocket = "^0.2.7"
znjson = "^0.2.4"
eventlet = "^0.38"


[tool.poetry.group.dev.dependencies]
eventlet = "^0"
pre-commit = "^3"
pytest = "^7"
coverage = "^7"
ruff = "^0.1"
ipykernel = "^6.29.4"
mdanalysis = {version = "^2"}
tidynamics = {version = "^1"}
rdkit2ase = {version = "^0.1"}
zntrack = {version = "^0.8"}
znh5md = {version = "^0.4"}
requires-python = ">=3.10"
dependencies = [
"ase>=3.24.0",
"celery>=5.4.0",
"eventlet>=0.39.0",
"flask>=3.1.0",
"flask-socketio>=5.5.1",
"networkx>=3.4.2",
"pandas>=2.2.3",
"plotly>=6.0.0",
"pydantic>=2.10.6",
"python-socketio[client]>=5.12.1",
"redis>=5.2.1",
"splines>=0.3.2",
"sqlalchemy>=2.0.38",
"tqdm>=4.67.1",
"typer>=0.15.1",
"znjson>=0.2.6",
"znsocket>=0.2.8",
]

[project.urls]
Repository = "https://github.com/zincware/ZnDraw"
Releases = "https://github.com/zincware/ZnDraw/releases"
Discord = "https://discord.gg/7ncfwhsnm4"
Documentation = "https://zndraw.readthedocs.io/"


[project.scripts]
zndraw = 'zndraw_app.cli:cli'

[tool.poetry.group.docs.dependencies]
sphinx = "^8.1.3"
furo = "^2024.8.6"
nbsphinx = "^0.9.5"
sphinx-copybutton = "^0.5.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
zndraw = 'zndraw_app.cli:cli'
requires = ["hatchling"]
build-backend = "hatchling.build"


[tool.poetry.urls]
repository = "https://github.com/zincware/ZnDraw"
[tool.hatch.build.targets.sdist]
exclude = [
"/app",
]

[tool.ruff]
line-length = 90
Expand All @@ -73,3 +60,20 @@ addopts = "-m 'not chrome'"

[tool.codespell]
skip = "*.svg,*.lock"

[dependency-groups]
dev = [
"coverage>=7.6.10",
"mdanalysis>=2.8.0",
"pytest>=8.3.4",
"rdkit2ase>=0.1.4",
"tidynamics>=1.1.2",
"znh5md>=0.4.4",
"zntrack>=0.8.2",
]
docs = [
"furo>=2024.8.6",
"nbsphinx>=0.9.6",
"sphinx>=8.1.3",
"sphinx-copybutton>=0.5.2",
]
Loading

0 comments on commit a93e874

Please sign in to comment.