Skip to content

Commit

Permalink
Merge pull request #13 from agronholm/overhaul (closes #10)
Browse files Browse the repository at this point in the history
Overhauled packaging and testing
  • Loading branch information
iamDyeus authored Oct 24, 2024
2 parents c151b35 + 107dba2 commit 878f957
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 107 deletions.
53 changes: 30 additions & 23 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,39 @@ name: Publish Python Package
on:
push:
tags:
- 'v*.*.*'
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"

jobs:
build:
runs-on: ubuntu-latest

environment: release
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: pip install build
- name: Create packages
run: python -m build
- name: Archive packages
uses: actions/upload-artifact@v4
with:
name: dist
path: dist

- name: Build package
run: python -m build

- name: Publish package to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: python -m twine upload dist/*
publish:
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Retrieve packages
uses: actions/download-artifact@v4
- name: Upload packages
uses: pypa/gh-action-pypi-publish@release/v1
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test suite

on:
push:
branches: [main]
pull_request:

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e .[test]
- name: Test with pytest
run: pytest -v
29 changes: 0 additions & 29 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.MD → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tkreload solves this issue by providing an automatic reload mechanism for termin
# Getting Started

## Prerequisites
- Python 3.7+
- Python 3.9+
- pip

## Installation
Expand Down
File renamed without changes.
48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[build-system]
requires = [
"setuptools >= 64",
"setuptools_scm >= 6.4"
]
build-backend = "setuptools.build_meta"

[project]
name = "tkreload"
description = "A library that auto reloads your tkinter app whenever file changes are detected."
readme = "README.md"
authors = [{name = "iamDyeus", email = "[email protected]"}]
license = {text = "Apache License 2.0"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9"
dependencies = [
"watchdog >= 5.0.3",
"rich >= 13.9.2"
]
dynamic = ["version"]

[project.urls]
Documentation = "https://github.com/iamDyeus/tkreload/blob/main/README.md"
"Bug Tracker" = "https://github.com/iamDyeus/tkreload/issues"
"Source code" = "https://github.com/iamDyeus/tkreload"

[project.optional-dependencies]
test = [
"pytest >= 7",
"pytest-cov"
]

[project.scripts]
tkreload = "kreload.main:main"

[tool.setuptools.packages.find]
include = ["tkreload", "tkreload.*"]
namespaces = false

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "dirty-tag"
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

10 changes: 2 additions & 8 deletions tkreload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@
applications, enhancing the development workflow for Tkinter-based projects.
"""

__all__ = ["TkreloadApp", "AutoReloadManager", "show_help"]

from .main import TkreloadApp, main
from .main import TkreloadApp
from .auto_reload import AutoReloadManager
from .help import show_help

__all__ = ["TkreloadApp", "AutoReloadManager", "show_help"]

__version__ = "1.0.1"
__author__ = "iamDyeus"
__license__ = "Apache 2.0"
__email__ = "[email protected]"

0 comments on commit 878f957

Please sign in to comment.