Skip to content

Commit

Permalink
add poetry config and minimal config for poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulRaven committed Jun 6, 2024
1 parent c3f01a8 commit 7998ecb
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = W503
max-line-length = 88
exclude = .git, .github, .eggs, __pycache__, build, dist, notebooks, .ipynb_checkpoints, logs
per-file-ignores = __init__.py:F401
18 changes: 18 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Upload Python Package
on:
release: [published]
permissions:
contents: read
jobs:
pypi-publish:
name: Upload release to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@ http://badge.fury.io/py/sgzenity
:target: http://sgzenity.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

SGZenity
******
# SGZenity

SGZenity is a library for python which was inspired by Zenity. When you write
scripts,
you can use SGZenity to create simple dialogs that interact graphically with the
user.
SGZenity is a library for python which was inspired by Zenity.

Requirements
============
When you write scripts, you can use SGZenity to create simple dialogs that interact graphically with the user.

## Requirements

* Python 3
* GTK+4
* python3-gi

Installation
============
## Installation

Install using pip :

Expand All @@ -37,14 +33,14 @@ $ cd ./sgzenity
$ python setup.py install
```

Example
=======
## Example

Simple dialog:

```python
from sgzenity import calendar
result = calendar(title="Awesome Calendar",text="Your birthday ?")
from src.sgzenity import calendar

result = calendar(title="Awesome Calendar", text="Your birthday ?")
print(result)
```
This code show a calendar dialog :
Expand All @@ -59,8 +55,7 @@ $ python test.py
$ (year=2017, month=6, day=4)
```

API
===
## API

```python
sgzenity.sgzenity.message(title='', text='', width=330, height=120, timeout=None)
Expand Down
7 changes: 7 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "sgzenity"
version = "0.1.0"
description = "sgzentry is a library for python which was inspired by Zenity. When you write scripts, you can use sgzentry to create simple dialogs that interact graphically with the user."
homepage="https://github.com/SoftGeekRO/sgzenity"
repository="https://github.com/SoftGeekRO/sgzenity.git"
documentation="https://github.com/SoftGeekRO/sgzenity/blob/main/README.md"
authors = [
"Zaharia Constantin <constantin.zaharia@sgsolar.ro>"
]
maintainers = []
license = "GPL-3.0-or-later"
readme = "README.md"
keywords=[
'zenity',
'python3',
'poetry',
'dialog',
'GTK+3'
]
classifiers=[
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14"
]
packages=[
{ include="sgzenity", from="src" }
]
include=[
"CHANGELOG.md"
]

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
watchdog = ">=4.0.0; python_version >= 3.10"
colorama = ">=0.4.6; python_version >= 3.10"
slugify = "^0.0.1"
PyGObject = "^3.48.2"

[tool.poetry.dev-dependencies]
isort = "^5.13.2"
black = "^24.4.2"
pytest = "^8.2.2"
pytest-cookies = "^0.7.0"
tox = "^4.15.1"
toml = "^0.10.2"
coverage = "^7.5.3"

[tool.poetry.extras]
lint = ["black", "isort"]
test = ["pytest", "pytest-cookies", "tox"]

[tool.poetry.plugins]

[tool.poetry.scripts]

[tool.poetry.urls]
"Source" = "https://github.com/soulraven/roundbox"
"Issues" = "https://github.com/soulraven/roundbox/issues"
"Discussions" = "https://github.com/soulraven/roundbox/discussions"
"Documentation" = "https://soulraven.github.io/roundbox/"
"Releases" = "https://soulraven.github.io/roundbox/releases"

[tool.black]
line_length = 88
target_version = ['py310']
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.github
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| \notebooks
| .ipynb_checkpoints
| __pycache__
| data
| logs
| _build
| buck-out
| build
| dist
| snapshots
)/
)
'''

[tool.isort]
py_version = 310
profile = "black"

[tool.flake8]
ignore = ['E231', 'E241']
per-file-ignores = [
'__init__.py:F401',
]
max-line-length = 88
count = true
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
url='https://github.com/SoftGeekRO/sgzenity.git',
author='SoulRaven',
author_email='constantin.zaharia@sgsolar.ro',
license='GPLv3',
license="LICENSE.md",
readme="README.md",
repository="https://github.com/soulraven/roundbox",
documentation="https://soulraven.github.io/roundbox/",
packages=['sgszenity'],
zip_safe=False
)
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tox]
skipsdist = true
envlist = py310

[gh-actions]
python =
3.10: py310

[testenv]
passenv = PYTHON_VERSION
whitelist_externals = poetry
commands =
poetry install -v
pytest --doctest-modules tests

[isort]
profile = black
multi_line_output = 3

0 comments on commit 7998ecb

Please sign in to comment.