Skip to content

Commit

Permalink
run scripts using project code
Browse files Browse the repository at this point in the history
  • Loading branch information
ihoubr committed Nov 18, 2024
1 parent db64f6c commit 4ff9d26
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions bin/say-moo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from px_demo import moo


def main():
moo.say_moo()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion pw
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import sys
from pathlib import Path
from venv import EnvBuilder

VERSION = "3.1.1"
VERSION = "3.1.3"

PYPROJECTX_INSTALL_DIR_ENV_VAR = "PYPROJECTX_INSTALL_DIR"
PYPROJECTX_PACKAGE_ENV_VAR = "PYPROJECTX_PACKAGE"
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[tool.pyprojectx]
lock-python-version = "3.8"
scripts_ctx = "venv" # all scripts in the bin directory can use project code and dependencies
[tool.pyprojectx.main]
requirements = ["uv", "ruff", "pre-commit", "px-utils", "httpie"]
post-install = "pre-commit install"

[tool.pyprojectx.venv]
dir = ".venv" # managed by uv
post-install = "@install" # make sure the venv is installed with all dependencies

[tool.pyprojectx.jupyter]
requirements = ["jupyterlab==4.3.0", "jupytext==1.16.4", "-e ."]
requirements = ["jupyterlab==4.3.0", "jupytext==1.16.4", "-e ."] # install the project in editable mode

[tool.pyprojectx.asciinema]
requirements = ["asciinema"]
requirements = ["asciinema"] # install asciinema separately from all other tools

[tool.pyprojectx.aliases]
install = "uv sync"
Expand Down Expand Up @@ -64,3 +69,4 @@ fixable = ["ALL"]
ignore = ["ISC001", "ANN", "FA", "FBT", "D100", "D102", "D103", "D104", "D105", "D213", "D203", "T201", "TRY003", "EM102", "COM812", "S602", "S603", "S604", "S605", "S607", "S324"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "I001", "INP001"]
"bin/*" = ['INP001']

0 comments on commit 4ff9d26

Please sign in to comment.