Skip to content

Commit

Permalink
Merge pull request #6 from nitfe/new-fixes
Browse files Browse the repository at this point in the history
Add pyproject.toml
  • Loading branch information
iamjazzar committed Feb 14, 2024
2 parents f0b3b80 + 30c244e commit cd331e8
Show file tree
Hide file tree
Showing 14 changed files with 1,038 additions and 6,573 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ celerybeat.pid
# Environments
.env
.venv
env/
venv/
*env/
*venv/
ENV/
env.bak/
venv.bak/
Expand Down
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ tarraz .tmp/palestinian_flag.jpg --colors 6 --stitches-count 100
```

### Python Example

```python
from tarraz import constants
from tarraz.processor import Tarraz
Expand Down Expand Up @@ -100,11 +101,29 @@ optional arguments:
--no-cleanup Don't run cleanup job on generated image.
--svg Export result to svg files.
```
## Development
make sure to add the project to your `PYTHONPATH`
## Pre-requisites
```shell
pip3 install -U pip setuptools
pip3 install poetry


# Optional Auto-completion
poetry completions zsh > ~/.zfunc/_poetry
```
### Install dependencies
```shell
$ export PYTHONPATH="${PYTHONPATH}:/path/to/tarraz"
```
poetry shell
poetry install
pre-commit install
```
> [!NOTE]
> If you don't want to keep the current package installed run
> `pip uninstall tarraz`. However, you might want to add the project
> to your `PYTHONPATH` using `export PYTHONPATH="${PYTHONPATH}:/path/to/tarraz"`
### Usage
Continue usage as listed above
201 changes: 201 additions & 0 deletions poetry.lock

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

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

[tool.isort]
profile = "hug"
src_paths = ["tarraz"]
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
default_section = "THIRDPARTY"
known_first_party = "tarraz"

[tool.poetry]
name = "tarraz"
version = "1.1.1"
description = "A cross-stitch image generator. Generates a cross stitch pattern given by a user and generates a DMC colored pattern."
authors = ["Ahmed Jazzar <ahmed@nitfe.com>"]
maintainers = []

license = "GNU Affero General Public License v3"
readme = "README.md"
packages = [{ include = "tarraz"}]
homepage = "https://www.nitfe.com/"
repository = "https://github.com/nitfe/tarraz.git"
documentation = "https://github.com/nitfe/tarraz/blob/main/README.md"
keywords = ["cross-stitch", "pattern", "stitch", "DMC"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

[tool.poetry.urls]
Issues = "https://github.com/nitfe/tarraz/issues"
Changelog = "https://github.com/nitfe/tarraz/releases"

# Requirements
[tool.poetry.dependencies]
python = ">=3.8"

[tool.poetry.dev-dependencies]
pre-commit = { version = "*" }

# Entry point
[tool.poetry.scripts]
tarraz = "tarraz.main:main"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

21 changes: 0 additions & 21 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit cd331e8

Please sign in to comment.