Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/release-drafter/release-drafter/refs/heads/master/schema.json
# Configuration for Release Drafter: https://github.com/release-drafter/release-drafter
name-template: '$RESOLVED_VERSION 🌈'
tag-template: '$RESOLVED_VERSION'
template: |
## What's Changed

$CHANGES
exclude-labels:
- 'skip-changelog'
- 'invalid'
42 changes: 42 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: CD
on:
workflow_dispatch:
release:
types: [published]
jobs:
publish-pypi:
runs-on: ubuntu-latest
name: Publish on PyPI
permissions:
id-token: write # IMPORTANT: Mandatory for Trusted Publishing (gh-action-pypi-publish)
contents: write # IMPORTANT: Mandatory for GitHub Release
# Specifying a GitHub environment is optional, but strongly encouraged
environment:
name: publish
url: https://pypi.org/project/ossin/${{ github.ref_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Restore cache
if: steps.setup-uv.outputs.cache-hit == 'true'
run: echo "Cache was restored"
- name: Build the Package
run: uv build --no-sources --quiet
- name: Publish to PyPI
run: uv publish --quiet --trusted-publishing always
- name: Attach Build Artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} ./dist/* --clobber
39 changes: 39 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Lint PR
on:
pull_request_target:
types: [opened, edited, synchronize, reopened]
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Lint PR Title
uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/[email protected]
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: CI
on:
workflow_dispatch:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: Run ossin on ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: System Info
shell: bash
run: |
if [[ ${{ matrix.os }} == "ubuntu-latest" ]]; then
echo "The system is Linux."
uname -a || true
lsb_release -a || true
gcc --version || true
elif [[ ${{ matrix.os }} == "macos-latest" ]]; then
echo "The system is macOS."
sw_vers || true
uname -a || true
gcc --version || true
elif [[ ${{ matrix.os }} == "windows-latest" ]]; then
echo "The system is Windows (using a Unix-like environment)."
systeminfo || true
else
echo "Unknown OS: $OS_TYPE"
exit 1
fi
- name: Environment Info
run: |
env || true
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Restore cache
if: steps.setup-uv.outputs.cache-hit == 'true'
run: echo "Cache was restored"
- name: Run CI
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
uv run ruff check
uv run ruff format
uv run mypy
uv run ty check
uv run pyrefly check
uv run pyright
uv run vulture
uv run validate-pyproject pyproject.toml
- name: Run ossin
run: |
uv run ossin --version
uv run ossin --no-color --format json
uv run ossin --no-color --format panels
uv run ossin --no-color --format table
23 changes: 23 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Release Drafter
on:
workflow_dispatch:
push:
branches: [main, master]
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write # IMPORTANT: Mandatory for Release Drafter (release-drafter)
pull-requests: write # IMPORTANT: Mandatory for Release Drafter (release-drafter)
runs-on: ubuntu-latest
steps:
- name: Draft a Release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,7 @@ __marimo__/

# Streamlit
.streamlit/secrets.toml

# Generated by Author
src/**/_version.py
.trunk/
54 changes: 54 additions & 0 deletions GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Development Guide

## Commands

### install

```sh
uv tool install hatch
uv sync
```

### init

```sh
uv run hatch new <package-name>
```

### bump

```sh
uv run hatch version major/minor/patch
```

### build

```sh
uv run hatch build
```

### unarchive-wheel

```sh
uv run -m zipfile -e dist/<package-name>-<version>-py3-none-any.whl dist/<package-name>-<version>-unpacked
# unzip dist/<package-name>-<version>-py3-none-any.whl -d dist/<package-name>-<version>-unpacked
```

### unarchive-tar-gz

```sh
uv run -m tarfile -e dist/<package-name>-<version>.tar.gz dist/<package-name>-<version>-unpacked
# tar -xzf dist/<package-name>-<version>.tar.gz -C dist/<package-name>-<version>-unpacked
```

### publish

```sh
hatch publish --repo test --user __token__ --auth <token>
```

### publish-test

```sh
uv pip install --index-url https://test.pypi.org/simple/ <package-name>
```
45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,10 @@ What is OS's sin? 🤔 A beautiful system information utility that displays basi

## Installation

### Using uv (recommended)

```sh
uv add ossin
```

### Using pip

```sh
pip install ossin
```

## Usage

### Basic Usage
Expand Down Expand Up @@ -99,28 +91,57 @@ ossin --help
- **Modern CLI**: Built with Typer for excellent CLI experience with type hints and auto-completion
- **Cross-platform**: Works on Windows, macOS, and Linux

<!-- xc-heading -->
## Development

### Setup
Clone the repository and cd into the project directory:

```sh
git clone https://github.com/python-ankara-toplulugu/ossin
cd ossin
```

The commands below can also be executed using the [xc task runner](https://xcfile.dev/), which combines the usage instructions with the actual commands. Simply run `xc`, it will pop up an interactive menu with all available tasks.

Clone the repository and install dependencies using uv:
### `install`

Install the dependencies:

```sh
uv sync
```

### Running the CLI
### `start`

Start the CLI:

```sh
uv run ossin
```

### Running tests
### `test`

Run the tests:

```sh
uv run pytest
```

### `ci`

Run the linters and type checkers:

```sh
uv run ruff check
uv run ruff format
uv run mypy
uv run ty check
uv run pyrefly check
uv run pyright
uv run vulture
uv run validate-pyproject pyproject.toml
```

## License

`ossin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
Loading
Loading