Skip to content

Commit

Permalink
revert README.md delete
Browse files Browse the repository at this point in the history
  • Loading branch information
ihoubr committed Jan 6, 2024
1 parent 3697da7 commit 33c3118
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 8 deletions.
10 changes: 3 additions & 7 deletions README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"id": "3709c81e",
"metadata": {},
"source": [
"Open [README.ipynb](README.ipynb) to view the full README (unfortunately github does not render notebook readme's)\n",
"\n",
"# Pyprojectx demo project\n",
"\n",
"Make it easy for your co-developers/contributors/tutorial readers to get started with your python project.\n",
Expand Down Expand Up @@ -94,9 +96,6 @@
"id": "1e04aa264b126d49",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%% md\n"
}
Expand All @@ -114,10 +113,7 @@
"cell_type": "markdown",
"id": "af19a5fb",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"## Getting started with pyprojectx in your own project\n",
Expand Down
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!--
---
jupyter:
jupytext:
hide_notebook_metadata: true
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.16.0
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---
-->

<!-- #region -->
Open [README.ipynb](README.ipynb) to view the full README (unfortunately github does not render notebook readme's)

# Pyprojectx demo project

Make it easy for your co-developers/contributors/tutorial readers to get started with your python project.

If you have python 3.8+ and git installed, you're ready to go. No need to install jupyter, libraries, etc.

Clone the project and start experimenting:

```shell
git clone https://github.com/houbie/px-demo.git
./pw notebook
```

Pyprojectx(https://github.com/houbie/pyprojectx) can turn your [pyproject.toml](./pyproject.toml)
config file into an executable build script.


Things you can try out:
* show help: `./pw --help` or `./pw -h`
* show available tools and commands: `./pw --info` or `./pw -i`
* run a pdm command: `./pw pdm --help`
* use httpie to execute https commands: `./pw https --help`
* just type the first letters if you don't remember the full command: `./pw c`
* just type enough (camel case) letters to identify an aliased command:
* `./pw post-json`
* `./pw pJ`
* `./pw p`

<!-- #endregion -->

## Python libraries
Make it a habit to manage the libraries that you use with a decent dependency manager like [Poetry](https://python-poetry.org/) or [PDM](https://pdm.fming.dev/).

So instead of using a _requirements.txt_, or worse, `pip install` instructions, list your dependencies in _pyproject.toml_.

No need to install anything, the pyprojectx wrapper script will make sure that the tools are available.
All the required tools are installed inside the project dir (cfg. npm dev dependencies).

Experimenting with your code in a Jupyter notebook f.e., becomes as easy as `./pw notebook`.

```python
# the project and all required libraries are automatically available here
from px_demo import plot
plot.simple_plot()
```

## Lightweight
The _pw_ wrapper script installs all the (Python) tools that your project uses in isolated virtual environments inside
_.pyprojectx_.

This is analogous to how npm stores everything in the _node_modules_ subdirectory of your project directory.

All commands and arguments are then forwarded to the resp. virtual environment by just typing _./pw_ in front.

<!-- #region pycharm={"name": "#%% md\n"} -->
## Simplified CI/CD pipelines
Run tests and build a distribution with `./pw build`. See it in action in this project's [github action workflow](.github/workflows/build.yml) or
the [pyprojectx workflow](https://github.com/houbie/pyprojectx/tree/main/.github/workflows) for a full example.

> **_NOTE:_** If your CI/CD server runs on both linux and windows, you can merge the linux style `./pw build` and the windows style `pw build`
> into a single command: `python pw build`
<!-- #endregion -->
## Getting started with pyprojectx in your own project
See the [documentation](https://pyprojectx.github.io/) for more details.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.pyprojectx]
main = ["pdm", "ruff", "pre-commit", "px-utils", "httpie"]
jupyter = ["jupyterlab", "-e ."]
jupyter = ["jupyterlab==4.0.10", "jupytext==1.16.0", "-e ."]

[tool.pyprojectx.aliases]
install = "pdm install"
Expand All @@ -14,6 +14,7 @@ outdated = "pdm update --outdated"
clean = "pxrm dist .venv .ipynb_checkpoints"
post-json = "https POST pie.dev/post message='Pyprojectx is awesome!'"
notebook = "jupyter lab -y"
generate-readme = { cmd = "jupytext --to=md --opt hide_notebook_metadata=true README.ipynb", ctx = "jupyter" }

[tool.pyprojectx.os.win.aliases]
clean = "rmdir /s/q __pypackages__ .pytest_cache dist"
Expand Down

0 comments on commit 33c3118

Please sign in to comment.