Skip to content

Commit

Permalink
Recover development flow (tests/CI); remove lxml dependency (via `p…
Browse files Browse the repository at this point in the history
…yquery`) (#312)

* Removed `pyquery` dependency (depends on `lxml`)

* Group python dependencies by functionaly

* Fixed ruff configuration

astral-sh/ruff#9406

* Rebase on `pytest-lazy-fixtures`

pytest-dev/pytest#11890

* Rename `check` to self-explanatory `type`
  • Loading branch information
roll authored Apr 11, 2024
1 parent 4271d11 commit 6ec7038
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build client dist docs format install lint preview release server start test version
.PHONY: all build client dist docs format install lint preview release server start test type version


VERSION := $(shell node -p -e "require('./package.json').version")
Expand Down Expand Up @@ -62,6 +62,11 @@ test:
hatch run test
npm run test

## Checks types with pyright and typescript
type:
hatch run type
npm run type

version:
@echo $(VERSION)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"scripts": {
"build": "electron-vite build",
"dist": "electron-builder",
"check": "tsc --noEmit",
"coverage": "sensible-browser coverage/index.html",
"format": "prettier --write \"client/**/*.ts*\" && eslint --fix \"client/**/*.ts*\"",
"lint": "prettier --check \"client/**/*.ts*\" && eslint \"client/**/*.ts*\"",
"prepare": "husky install",
"preview": "electron-vite dev",
"start": "vite --open --port 8080",
"spec": "vitest run",
"test": "npm run lint && npm run check && npm run spec",
"test": "npm run lint && npm run type && npm run spec",
"type": "tsc --noEmit",
"update": "ncu -u"
},
"dependencies": {
Expand Down
46 changes: 26 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,38 @@ name = "opendataeditor"
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = [
# Core
"fastapi==0.103.1",
"fastparquet==2023.8.0",
"frictionless-ckan-mapper==1.0.9",
"frictionless==5.16.0",
"gitignore-parser==0.1.6",
"ijson==3.2.3",
"jinja2==3.1.2",
"jsonlines==4.0.0",
"marko==2.0.0",
"openai==0.28.0",
"openpyxl==3.1.2",
"pandas==2.1.1",
"pydantic==2.3.0",
"pygithub==1.59.1",
"pyquery==2.0.0",
"python-multipart==0.0.6",
"pyzenodo3==1.0.2",
"sqlalchemy==2.0.20",
"tinydb==4.8.0",
"typer==0.9.0",
"typing_extensions==4.8.0",
"uvicorn==0.23.2",
# Articles
"jinja2==3.1.2",
"marko==2.0.0",
# Scripts
"pandas==2.1.1",
# Excel
"openpyxl==3.1.2",
"xlrd==2.0.1",
"xlwt==1.3.0",
# JSON
"ijson==3.2.3",
"jsonlines==4.0.0",
# Parquet
"fastparquet==2023.8.0",
# CKAN
"frictionless-ckan-mapper==1.0.9",
# Github
"pygithub==1.59.1",
# Zenodo
"pyzenodo3==1.0.2",
]

[tool.setuptools]
Expand All @@ -52,32 +60,30 @@ dependencies = [
"pytest-only",
"pytest-dotenv",
"pytest-timeout",
"pytest-lazy-fixture",
"pytest-lazy-fixtures",
]

[tool.hatch.envs.default.scripts]
build = [
"python -m build",
]
check = [
"pyright server",
]
format = [
"ruff server --fix",
"ruff format server",
]
lint = [
"ruff server",
"ruff format server --check",
"ruff check server",
]
start = [
"watchfiles 'python -m server {args:tmp/project}' server",
]
test = [
"hatch run lint",
"hatch run check",
"hatch run type",
"hatch run pytest",
]
type = [
"pyright server",
]

[tool.ruff]
line-length = 90
Expand All @@ -86,7 +92,7 @@ line-length = 90
ignore = ["E501", "E731"]
select = ["I"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]

[tool.pytest.ini_options]
Expand Down

0 comments on commit 6ec7038

Please sign in to comment.