Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Minor improvements #229

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .example.pypirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[distutils]
index-servers = forgejo

[forgejo]
repository = https://things.com
username = {username}
password = {password}
Comment on lines +1 to +7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this file is for

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local pypi server template. will remove if you want.

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ eggs/
lib/
lib64/
parts/
dist/
sdist/
var/
wheels/
Expand Down Expand Up @@ -158,5 +159,5 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.vscode/
.idea/
.vscode/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yafti
abanna marked this conversation as resolved.
Show resolved Hide resolved
52 changes: 49 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ actions:
pre:
- run: /full/path/to/bin --with --params
- run: /another/command run
- yafti.plugin.flatpak:
- yafti.plugins.flatpak:
install: org.gnome.Calculator
post:
- run: /run/these/commands --after --all --screens
Expand All @@ -83,7 +83,7 @@ screens:
values:
title: Package Installation
show_terminal: true
package_manager: yafti.plugin.flatpak
package_manager: yafti.plugins.flatpak
groups:
Core:
description: All the good stuff
Expand Down Expand Up @@ -117,8 +117,54 @@ This project uses Poetry and Python 3.11. Make sure you have Python 3.11 and [Po

If you're on a Ublue / immutable OS, you'll need to run these and the poetry install in a toolbox.

[cairographics](https://www.cairographics.org/download/)


#### distrobox

the following just commands will create a distro box container

```shell
just create-distrobox
just enter-distrobox
```

After entering the distro box

```shell
# prints fedora info
fastfetch

# launches the app
just run
```

#### deb based developer prerequisites

```shell
sudo apt update
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ibgirepository1.0-dev libcairo2-dev
```

#### https://iconduck.com/icons/164466/emblem-system-symbolic


#### rhel based developer prerequisites

```
sudo dnf install python3-devel cairo-devel gobject-introspection-devel cairo-gobject-devel vte291-gtk4-devel
```
sudo dnf install python3-devel cairo-devel gobject-introspection-devel cairo-gobject-devel

#### pyenv installer

```shell
curl https://pyenv.run | bash
pyenv install 3.11.8
pyenv virtualenv 3.11.8 yafti
pyenv activate yafti
pip install --upgrade pip
pip install poetry

poetry install
```

Expand Down
9 changes: 9 additions & 0 deletions distrobox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[yaftibox]
image=ghcr.io/ublue-os/fedora-toolbox:latest
additional_packages="just fastfetch redhat-lsb-core poetry black python3-isort python3-devel gtk3 gtk4 cairo-devel gobject-introspection-devel cairo-gobject-devel libadwaita-devel vte291-gtk4-devel"
nvidia=false
init=false
pull=true
root=false
replace=true
start_now=true
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Yet Another First Time Installer

TODO add content for generated Github pages.
111 changes: 111 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# justfile docs https://just.systems/man/en/
# justfile cheatsheet https://cheatography.com/linux-china/cheat-sheets/justfile/
set dotenv-load := true
set export

project := "yafti"
host := `uname -a`
python_exe := `which python`
pip_exe := `which pip3`
project_path := invocation_directory()
module_path := join(project_path, 'yafti')

###
# need to add readme to docs and run a full suite of test etc
# absolute_path parent_directory justfile_directory
# https://github.com/python-poetry/poetry python package and venv manager.
# https://unicode.org/emoji/charts/emoji-list.html#1fae1 emoji's
###
bt := '0'

export RUST_BACKTRACE_1 := bt
export JUST_LOG := "warn"

sys-info:
@echo '{{host}}'

python:
@echo 'Python:' `poetry run python --version`
@echo 'Python Path:' `poetry env info`
@echo 'Python Path:' `which python`
#
@dev deps="yes":
pip install poetry pip --upgrade
poetry install --with docs

build deps="yes": (dev deps)
@echo "building wheel"
poetry build

# set-hooks: dev
# pre-commit
# poetry run pre-commit install --install-hooks # uninstall: `pre-commit uninstall`

unit-test deps="no": (dev deps)
@echo 'unit-tests'
poetry run pytest --cov={{ module_path}} --cov-report=term-missing

type-checks deps="no": (dev deps)
@echo 'type checking'
poetry run mypy {{ module_path }}

format deps="no": (dev deps)
@echo 'black isort and ruff being called into action'
poetry run black {{ module_path }}
poetry run isort {{ module_path }}
poetry run ruff check {{ module_path }}

# TODO: i like flake8
#lint deps="no": (dev deps)
# @echo "linting code base"
# poetry run flake8 {{ module_path }} \
# --max-line-length 100 \
# --ignore=F401,E731,F403,E501,W503 \
# --count

coverage-report:
@echo "Building test coverage report"
# poetry run pytest --cov=yafti --cov-report=term-missing
poetry run pytest --cov={{ module_path }} --cov-config=.coveragerc --cov-report html

sphinx deps="no": (dev deps)
@echo "Building application documentation"
mkdir -p docs/html
touch docs/.nojekyll
cd docs/ && poetry run sphinx-build -b html . _build
cp -r docs/_build/* docs/html

docs deps="no": (dev deps)
@echo "Run auto build and start http server."
poetry run sphinx-autobuild docs docs/_build/html

run deps="no": (dev deps)
# not sure why GTK_IM_MODULE is required in the distrobox. I need to test on a physical installation.
export GTK_IM_MODULE=ibus
# poetry run python -m {{ project }}.cli start tests/bazzite.yaml --debug -f
poetry run python -m {{ project }}.cli start tests/bluefin.yml --debug -f
# poetry run python -m {{ project }}.cli start tests/example.yml --debug

create-distrobox:
distrobox-assemble create --file {{ project_path }}/distrobox.ini

enter-distrobox:
distrobox-enter yaftibox

help:
just -l


###
# Need to add a just command for glib-compile-schemas
###

###
# Add just command for running act local github runners
###

###
# gnome extension mangement.
# https://github.com/essembeh/gnome-extensions-cli/
###

Loading