Metadata-Version: 2.1
Name: nodeps
Version: 0.1.8
Summary: Python helpers and utilities with no dependencies
Author-email: José Antonio Puértolas Montañés <63794670+j5pu@users.noreply.github.com>
License: MIT
Project-URL: Homepage, https://github.com/j5pu/nodeps
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: all
Requires-Dist: nodeps[ansi] ; extra == 'all'
Requires-Dist: nodeps[cli] ; extra == 'all'
Requires-Dist: nodeps[echo] ; extra == 'all'
Requires-Dist: nodeps[log] ; extra == 'all'
Requires-Dist: nodeps[pickle] ; extra == 'all'
Requires-Dist: nodeps[pretty] ; extra == 'all'
Requires-Dist: nodeps[pth] ; extra == 'all'
Requires-Dist: nodeps[repo] ; extra == 'all'
Requires-Dist: nodeps[requests] ; extra == 'all'
Provides-Extra: ansi
Requires-Dist: strip-ansi <1,>=0.1.1 ; extra == 'ansi'
Provides-Extra: cli
Requires-Dist: tomlkit <1,>=0.12.1 ; extra == 'cli'
Requires-Dist: typer[all] <1,>=0.9 ; extra == 'cli'
Provides-Extra: dev
Requires-Dist: black[d] <24,>=23.9.1 ; extra == 'dev'
Requires-Dist: build <2,>=1.0.3 ; extra == 'dev'
Requires-Dist: hunter <4,>=3.6.1 ; extra == 'dev'
Requires-Dist: icecream <3,>=2.1.3 ; extra == 'dev'
Requires-Dist: ipython <9,>=8.16.0 ; extra == 'dev'
Requires-Dist: ipython-suggestions <2,>=1.0.0 ; extra == 'dev'
Requires-Dist: restmagic <1,>=0.7.2 ; extra == 'dev'
Requires-Dist: mypy <2,>=1.5.1 ; extra == 'dev'
Requires-Dist: pyflyby <2,>=1.8.6 ; extra == 'dev'
Requires-Dist: rich <14,>=13.6.0 ; extra == 'dev'
Requires-Dist: twine <5,>=4.0.2 ; extra == 'dev'
Requires-Dist: tomlkit <1,>=0.12.1 ; extra == 'dev'
Requires-Dist: docutils ; extra == 'dev'
Requires-Dist: furo <2024,>=2023.9.10 ; extra == 'dev'
Requires-Dist: myst-parser <3,>=2.0.0 ; extra == 'dev'
Requires-Dist: sphinx <8,>=7.2.6 ; extra == 'dev'
Requires-Dist: sphinx-autodoc-typehints ; extra == 'dev'
Requires-Dist: sphinx-autobuild <2022,>=2021.3.14 ; extra == 'dev'
Requires-Dist: sphinx-click <6,>=5.0.1 ; extra == 'dev'
Requires-Dist: sphinxcontrib-napoleon <1,>=0.7 ; extra == 'dev'
Requires-Dist: coverage[toml] <7,>=6 ; extra == 'dev'
Requires-Dist: darglint <2,>=1.8.1 ; extra == 'dev'
Requires-Dist: environs <10,>=9.5.0 ; extra == 'dev'
Requires-Dist: pycodestyle <3,>=2.11.0 ; extra == 'dev'
Requires-Dist: pydocstyle <7,>=6.3 ; extra == 'dev'
Requires-Dist: pytest <8,>=7 ; extra == 'dev'
Requires-Dist: pytest-asyncio <1,>=0.21.1 ; extra == 'dev'
Requires-Dist: pytest-clarity <2,>=1.0.1 ; extra == 'dev'
Requires-Dist: pytest-cov <5,>=4 ; extra == 'dev'
Requires-Dist: pytest-doctestplus <1,>=0.13 ; extra == 'dev'
Requires-Dist: pytest-git <2,>=1.7.0 ; extra == 'dev'
Requires-Dist: pytest-git-fixtures <1,>=0.1.7 ; extra == 'dev'
Requires-Dist: pytest-github-actions-annotate-failures <1,>=0.2.0 ; extra == 'dev'
Requires-Dist: pytest-mock <4,>=3 ; extra == 'dev'
Requires-Dist: pytest-xdist <3,>=2 ; extra == 'dev'
Requires-Dist: pytest-remotedata <1,>=0.4.0 ; extra == 'dev'
Requires-Dist: pytest-lazy-fixture ~=0.6.3 ; extra == 'dev'
Requires-Dist: pytest-sugar <1,>=0.9.7 ; extra == 'dev'
Requires-Dist: responses <1,>=0.21.0 ; extra == 'dev'
Requires-Dist: requests-mock <2,>=1.10.0 ; extra == 'dev'
Requires-Dist: ruff <0.1,>=0.0.282 ; extra == 'dev'
Requires-Dist: ruff-lsp <0.1,>=0.0.39 ; extra == 'dev'
Requires-Dist: tox <5,>=4.6.4 ; extra == 'dev'
Requires-Dist: types-pytest-lazy-fixture >=0.6.3.3 ; extra == 'dev'
Provides-Extra: echo
Requires-Dist: typer[all] <1,>=0.9 ; extra == 'echo'
Provides-Extra: log
Requires-Dist: loguru <1,>=0.7.2 ; extra == 'log'
Provides-Extra: pickle
Requires-Dist: jsonpickle <4,>=3.0.2 ; extra == 'pickle'
Requires-Dist: structlog <24,>=23.1.0 ; extra == 'pickle'
Provides-Extra: pretty
Requires-Dist: rich <14,>=13.6.0 ; extra == 'pretty'
Provides-Extra: pth
Requires-Dist: setuptools <69,>=68.2.2 ; extra == 'pth'
Provides-Extra: repo
Requires-Dist: gitpython <4,>=3.1.37 ; extra == 'repo'
Provides-Extra: requests
Requires-Dist: beautifulsoup4 <5,>=4.12.2 ; extra == 'requests'
Requires-Dist: requests <3,>=2.31.0 ; extra == 'requests'

# NoDeps

[![PyPI](https://img.shields.io/pypi/v/nodeps.svg)][pypi status]
[![Status](https://img.shields.io/pypi/status/nodeps.svg)][pypi status]
[![Python Version](https://img.shields.io/pypi/pyversions/nodeps)][pypi status]
[![License](https://img.shields.io/pypi/l/nodeps)][license]

[![Read the documentation at https://sbit.readthedocs.io/](https://img.shields.io/readthedocs/nodeps/latest.svg?label=Read%20the%20Docs)][read the docs]
[![Tests](https://github.com/j5pu/nodeps/workflows/Tests/badge.svg)][tests]
[![Codecov](https://codecov.io/gh/j5pu/nodeps/branch/main/graph/badge.svg)][codecov]

[pypi status]: https://pypi.org/project/nodeps/

[read the docs]: https://nodeps.readthedocs.io/

[tests]: https://github.com/j5pu/nodeps/actions?workflow=Tests

[codecov]: https://app.codecov.io/gh/j5pu/nodeps

[pre-commit]: https://github.com/pre-commit/pre-commit

[black]: https://github.com/psf/black

## Features

### proj

#### Automatic installation of packages

`PipMetaPathFinder` is a `sys.meta_path` finder that automatically installs packages when they are imported.

#### Task dependencies
- `venv` runs `write` and `requirements`
- `build` runs  `venv`, `completions`, `docs` and `clean`.
- `tests` runs `build`, `ruff`, `pytest` and `tox`
- `publish` runs `tests`, `commit`, `tag`, `push`, `twine` and `clean`

#### Completions

To install completions after a package is installed:
`proj completions [name]` or `completions [name]`

#### Repos

To synchronize (push or pull) all repos under `~/Archive` and `$HOME` run: `repos --sync` or `proj repos --sync`

#### pyproject.toml

##### Project

Project section information in `pyproject.toml` is automatically updated when `Project.write()` is called, is key is not in project. 
An empty `pyproject.toml` is needed.

##### Extras
To use all extras from nodeps to your project, add the following to your `pyproject.toml`:

```toml
[project.optional-dependencies]
dev = [
    "nodeps[all]",
]
```

#### docs conf.py and requirements.txt

doc `conf.py`,  `reference.md` and `requirements.txt` are automatically updated when `Project.write()` is called.

#### Makefile

```makefile
.PHONY: docs tests venv

brew:
	@proj $@ --command gh

browser:
	@$@

build:  # Build a project `venv`, `completions`, `docs` and `clean`.
	@$@

clean:
	@$@

commit: tests
	@$@

completions:
	@$@

coverage:
	@proj $@

docs:
	@$@

latest:
	@$@

next:
	@$@

nodeps:
	@python3 -m pip install -q $@
    
publish:  # runs `tests`, `commit`, `tag`, `push`, `twine` and `clean`
	@$@

pyenv:
	@pyenv install 3.11
	@pyenv install 3.12-dev

pytest:
	@proj $@

requirements:
	@$@ --install

ruff:
	@proj $@

secrets:
	@$@

tests:  # runs `build`, `ruff`, `pytest` and `tox`
	@$@

tox:
	@proj $@

twine:
	@proj $@

venv:  # runs `write` and `requirements`
	@$@

.DEFAULT_GOAL := publish
```

### Extras:
- `ansi`: for `getstdout` and `strip` function using `strip-ansi` library
- `cli`: for `typer` to have CLI for `proj` command
- `echo`: for `echo` package using `click` library
- `log`: for `logger` function using `loguru` library
- `pickle`: for `cache` function using `jsonpickle` and `structlog` libraries
- `pth`: for `PTHBuildPy`, `PTHDevelop`, `PTHEasyInstall` and `PTHInstallLib` classes using `setuptools` library
- `pretty`: for `rich` library install and `icecream.ic` configuration 
- `repo`: for `Repo` class using `gitpython` library
- `requests`: for `python_latest`, `python_versions` and `request_x_api_key_json` functions that use the `requests` and `beautifulsoup4` libraries

Test imports uninstalling: `pip uninstall loguru beautifulsoup4 click jsonpickle strip_ansi structlog typer`

### PTH

Add to your `setup.cfg` and `<mypackage>.pth` file in your package.

```ìni
[options]
cmdclass =
  build_py = nodeps.PTHBuildPy
  develop = nodeps.PTHDevelop
  easy_install = nodeps.PTHEasyInstall
  install_lib = nodeps.PTHInstallLib
[options.package_data]
mypackage =
  *.pth
```

Add to your `pyproject.toml`:

```toml
[build-system]
requires = [
    "nodeps",
    "setuptools >= 68.2.2, <69",
    "setuptools_scm >= 8.0.3, <9",
    "wheel >= 0.41.2, <1"
]
```

To verify that `nodeps.pth` is being installed use:
`python -c "import venv; print(venv.CORE_VENV_DEPS)"`

### Post install

File `_post_install.py` is automatically executed after `pip install` with the `pip` install patch.

## Installation

You can install _nodeps_ via [pip] from [PyPI]:

```console
$ pip install nodeps
```

You can install _nodeps_ with extras [pip] from [PyPI]:

```console
$ pip install nodeps[repo]
```

To install all extras (not including development extras):

```console
$ pip install nodeps[all]
```

## License

Distributed under the terms of the [MIT license][license],
_nodeps_ is free and open source software.

## Issues

If you encounter any problems,
please [file an issue] along with a detailed description.

## Credits

[@j5pu]: https://github.com/j5pu

[pypi]: https://pypi.org/

[file an issue]: https://github.com/j5pu/nodeps/issues

[pip]: https://pip.pypa.io/

<!-- github-only -->

[license]: https://github.com/j5pu/nodeps/blob/main/LICENSE

[command-line reference]: https://nodeps.readthedocs.io/en/latest/usage.html
