Skip to content

Commit

Permalink
Change pdm to rye
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiMozaffar committed Apr 29, 2024
1 parent a0b789e commit 3204a17
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 1,532 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ __pycache__/
.pdm-python
.pdm-build/
__pypackages__/

# rye
.python-version
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@ path = src/python-fastui

.PHONY: install
install:
cd src/python-fastui && pdm install
cd demo && pdm install
cd src/python-fastui && rye sync
cd demo && rye sync

.PHONY: update-lockfiles
update-lockfiles:
cd src/python-fastui && pdm sync
cd demo && pdm sync
cd src/python-fastui && rye lock
cd demo && rye lock

.PHONY: format
format:
cd src/python-fastui && pdm run ruff check --fix-only .
cd demo && pdm run ruff check --fix-only .
cd src/python-fastui && rye run ruff check --fix-only .
cd demo && rye run ruff check --fix-only .

.PHONY: lint
lint:
cd src/python-fastui && pdm run ruff check .
cd src/python-fastui && rye run ruff check .

.PHONY: lint-demo
lint-demo:
cd demo && pdm run ruff check .
cd demo && rye run ruff check .


.PHONY: typecheck
typecheck:
cd src/python-fastui && pdm run pyright fastui
cd src/python-fastui && rye run pyright fastui

.PHONY: typecheck-demo
typecheck-demo:
cd demo && pdm run pyright src
cd demo && rye run pyright src


.PHONY: test
test:
cd src/python-fastui && pdm run coverage run -m pytest tests
cd src/python-fastui && rye run coverage run -m pytest tests

.PHONY: test-demo
test-demo:
cd demo && pdm run pytest tests
cd demo && rye run pytest tests

.PHONY: testcov
testcov: test
cd src/python-fastui && pdm run coverage html
cd src/python-fastui && rye run coverage html

.PHONY: testcov-report
testcov-report:
cd src/python-fastui && pdm run coverage report --fail-under=80
cd src/python-fastui && rye run coverage report --fail-under=80

testcov-xml:
cd src/python-fastui && pdm run coverage xml
cd src/python-fastui && rye run coverage xml

.PHONY: typescript-models
typescript-models:
Expand Down
740 changes: 0 additions & 740 deletions demo/pdm.lock

This file was deleted.

38 changes: 19 additions & 19 deletions demo/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ allow-direct-references = true
name = 'src'
description = 'FastUI demo project'
authors = [{ name = 'Samuel Colvin', email = '[email protected]' }]
license = 'MIT'
classifiers = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
Expand All @@ -22,7 +21,6 @@ classifiers = [
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: Unix',
'Operating System :: POSIX :: Linux',
'Environment :: Console',
Expand All @@ -34,34 +32,18 @@ classifiers = [
]
requires-python = '>=3.8'
dependencies = [
"fastui @ file:///${PROJECT_ROOT}/../src/python-fastui",
"fastapi>=0.110.2",
"httpx>=0.27.0",
"openai==1.10.0",
"PYjwt>=2.8.0",
"pydantic[email]>=2.7.1",
]
dynamic = ['version', 'readme']
dynamic = ['version']


[tool.pdm]
distribution = false

[tool.pdm.dev-dependencies]
dev = [
"pyright>=1.1.360",
"dirty-equals>=0.7.1.post0",
"coverage==7.4.1",
"rich==13.7.0",
"pytest-pretty==1.2.0",
"pytest-asyncio==0.23.4",
"dirty-equals==0.7.1.post0",
"markdown-it-py==3.0.0",
"pytest==7.4.4",
"pyright==1.1.335",
"ruff==0.2.1",
"mypy~=1.1.1",
]

[tool.ruff]
line-length = 120
Expand Down Expand Up @@ -105,3 +87,21 @@ quote-style = 'single'
source = ['pydantic']
branch = true
context = '${CONTEXT}'


[tool.rye]
managed = true
dev-dependencies = [
"fastui @ file:///${PROJECT_ROOT}/../src/python-fastui",
"dirty-equals>=0.7.1.post0",
"coverage==7.4.1",
"rich==13.7.0",
"pytest-pretty==1.2.0",
"pytest-asyncio==0.23.4",
"dirty-equals==0.7.1.post0",
"markdown-it-py==3.0.0",
"pytest==7.4.4",
"pyright==1.1.335",
"ruff==0.2.1",
"mypy~=1.1.1",
]
96 changes: 96 additions & 0 deletions demo/requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

-e file:.
annotated-types==0.6.0
# via pydantic
anyio==4.3.0
# via httpx
# via openai
# via starlette
certifi==2024.2.2
# via httpcore
# via httpx
coverage==7.4.1
dirty-equals==0.7.1.post0
distro==1.9.0
# via openai
dnspython==2.6.1
# via email-validator
email-validator==2.1.1
# via pydantic
fastapi==0.110.2
# via src
fastui @ file:///${PROJECT_ROOT}/../src/python-fastui
h11==0.14.0
# via httpcore
httpcore==1.0.5
# via httpx
httpx==0.27.0
# via openai
# via src
idna==3.7
# via anyio
# via email-validator
# via httpx
iniconfig==2.0.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.1.1
mypy-extensions==1.0.0
# via mypy
nodeenv==1.8.0
# via pyright
openai==1.10.0
# via src
packaging==24.0
# via pytest
pluggy==1.5.0
# via pytest
pydantic==2.7.1
# via fastapi
# via fastui
# via openai
# via src
pydantic-core==2.18.2
# via pydantic
pygments==2.17.2
# via rich
pyjwt==2.8.0
# via src
pyright==1.1.335
pytest==7.4.4
# via pytest-asyncio
# via pytest-pretty
pytest-asyncio==0.23.4
pytest-pretty==1.2.0
pytz==2024.1
# via dirty-equals
rich==13.7.0
# via pytest-pretty
ruff==0.2.1
setuptools==69.5.1
# via nodeenv
sniffio==1.3.1
# via anyio
# via httpx
# via openai
starlette==0.37.2
# via fastapi
tqdm==4.66.2
# via openai
typing-extensions==4.11.0
# via fastapi
# via mypy
# via openai
# via pydantic
# via pydantic-core
61 changes: 61 additions & 0 deletions demo/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

-e file:.
annotated-types==0.6.0
# via pydantic
anyio==4.3.0
# via httpx
# via openai
# via starlette
certifi==2024.2.2
# via httpcore
# via httpx
distro==1.9.0
# via openai
dnspython==2.6.1
# via email-validator
email-validator==2.1.1
# via pydantic
fastapi==0.110.2
# via src
h11==0.14.0
# via httpcore
httpcore==1.0.5
# via httpx
httpx==0.27.0
# via openai
# via src
idna==3.7
# via anyio
# via email-validator
# via httpx
openai==1.10.0
# via src
pydantic==2.7.1
# via fastapi
# via openai
# via src
pydantic-core==2.18.2
# via pydantic
pyjwt==2.8.0
# via src
sniffio==1.3.1
# via anyio
# via httpx
# via openai
starlette==0.37.2
# via fastapi
tqdm==4.66.2
# via openai
typing-extensions==4.11.0
# via fastapi
# via openai
# via pydantic
# via pydantic-core
9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
[tool.ruff]
line-length = 120
extend-select = ["Q", "RUF100", "UP", "I"]
flake8-quotes = {inline-quotes = "single", multiline-quotes = "double"}
format.quote-style="single"
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
format.quote-style = "single"
target-version = "py38"

[tool.pyright]
include = ["src/python-fastui/fastui"]

[tool.pytest.ini_options]
testpaths = [
"src/python-fastui/tests",
"demo/tests.py",
]
testpaths = ["src/python-fastui/tests", "demo/tests"]
xfail_strict = true
filterwarnings = ["error"]
asyncio_mode = "auto"
Expand Down
Loading

0 comments on commit 3204a17

Please sign in to comment.