Compare commits

...

4 commits

10 changed files with 100 additions and 50 deletions

View file

@ -2,9 +2,10 @@ name: GitHub Pages
on:
push:
tags: ["v*.*"]
tags: [ "v*.*" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04

29
.github/workflows/pypi.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Build and Publish to PyPI
on:
workflow_call:
workflow_dispatch:
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

29
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: 🚀 Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build-n-publish:
uses: ./.github/workflows/pypi.yml
create-release:
env:
GH_TOKEN: ${{ github.token }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: update latest tag
uses: richardsimko/update-tag@v1
with:
tag_name: latest
- name: Generate New Release
run: |
gh release create ${{ github.ref }}

1
.gitignore vendored
View file

@ -172,5 +172,6 @@ poetry.toml
.task.mk
# copy of README.md
docs/index.md
docs/cli.md
docs/viv.py
docs/svgs

View file

@ -35,7 +35,8 @@ docs/viv.py: src/viv/viv.py
cp $< $@
docs/index.md: README.md
cp $< $@
printf -- '---\nhide: [navigation]\n---\n\n' > $@
cat $< >> $@
examples/black: .FORCE
rm -f $@

View file

@ -1,3 +1,13 @@
<!-- badges -->
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![PYPI][pypi-shield]][pypi-url]
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com)
<!--[![Conda][conda-shield]][conda-url]-->
<div align="center">
<a href="https://github.com/daylinmorgan/viv">
<img src="https://raw.githubusercontent.com/daylinmorgan/viv/main/assets/logo.svg" alt="Logo" width=500 >
@ -123,3 +133,14 @@ python3 <(curl -fsSL viv.dayl.in/viv.py) shim black -o ./black --standalone --fr
[^1]: You do need to have `pip` but surely you have `pip` already.
<!-- [conda-shield]: https://img.shields.io/conda/vn/conda-forge/viv-->
<!-- [conda-url]: https://anaconda.org/conda-forge/viv -->
[pypi-shield]: https://img.shields.io/pypi/v/viv
[pypi-url]: https://pypi.org/project/viv
[stars-shield]: https://img.shields.io/github/stars/daylinmorgan/viv.svg
[stars-url]: https://github.com/daylinmorgan/viv/stargazers
[issues-shield]: https://img.shields.io/github/issues/daylinmorgan/viv.svg
[issues-url]: https://github.com/daylinmorgan/viv/issues
[license-shield]: https://img.shields.io/github/license/daylinmorgan/viv.svg
[license-url]: https://github.com/daylinmorgan/viv/blob/main/LICENSE

View file

@ -1,43 +0,0 @@
# cli
![help](./svgs/viv-help.svg)
## list
![cmd](./svgs/viv-list-help.svg)
## exe
![cmd](./svgs/viv-exe-help.svg)
## manage
![cmd](./svgs/viv-manage-help.svg)
### manage update
![cmd](./svgs/viv-manage-update-help.svg)
### manage purge
![cmd](./svgs/viv-manage-purge-help.svg)
### manage show
![cmd](./svgs/viv-manage-show-help.svg)
### manage install
![cmd](./svgs/viv-manage-install-help.svg)
## freeze
![cmd](./svgs/viv-freeze-help.svg)
## shim
![cmd](./svgs/viv-shim-help.svg)
## run
![cmd](./svgs/viv-run-help.svg)
## cache
![cmd](./svgs/viv-cache-help.svg)
### cache info
![cmd](./svgs/viv-cache-info-help.svg)
### cache remove
![cmd](./svgs/viv-cache-remove-help.svg)

View file

@ -4,12 +4,18 @@ repo_url: https://github.com/daylinmorgan/viv
edit_uri: edit/main/docs/
repo_name: daylinmorgan/viv
nav:
- home: index.md
- cli: cli.md
theme:
name: material
logo: https://raw.githubusercontent.com/daylinmorgan/viv/main/assets/logo.svg
favicon: https://raw.githubusercontent.com/daylinmorgan/viv/main/assets/logo.svg
features:
- navigation.tabs
- navigation.indexes
palette:
# Palette toggle for dark mode
- scheme: slate
@ -27,4 +33,3 @@ theme:
markdown_extensions:
- footnotes

View file

@ -28,7 +28,11 @@ CLI_DOC_PATH = DOCS_PATH / "cli.md"
)
cli_doc = """
cli_doc = """\
---
hide: [navigation]
---
# cli
![help](./svgs/viv-help.svg)

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env -S python3 -S
"""viv isn't venv!
viv -h
@ -52,7 +52,7 @@ from typing import (
Union,
)
__version__ = "23.8b2-2-g2adcd6f-dev"
__version__ = "23.8b2-6-gdafa099-dev"
class Spinner:
@ -994,7 +994,9 @@ class ViVenv:
return len([f for f in self.meta.files if Path(f).is_file()]) == 0
def get_size(self) -> None:
size = float(sum(p.stat().st_size for p in Path(self.path).rglob("*")))
size = float(
sum(p.stat().st_size for p in Path(self.path).rglob("*") if p.is_file())
)
for unit in ("B", "K", "M", "G", "T"):
if size < 1024:
break