diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..9c26666 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,30 @@ +## What type of issue is this? +- [ ] Bug report +- [ ] Feature request +- [ ] Question +- [ ] Other (please describe below) + +## Description +_A clear and concise description of what the issue is or what you are requesting._ + +## Steps to Reproduce (for bugs) +1. +2. +3. + +## Expected Behavior +_What did you expect to happen?_ + +## Actual Behavior (for bugs) +_What actually happened?_ + +## Screenshots or Logs (if applicable) +_Add screenshots, error messages, or logs to help explain your problem._ + +## Additional Context +_Add any other context about the problem or request here._ + +## Environment (please complete the following information if relevant) +- OS: [e.g. Windows, Mac, Linux] +- Python version: [e.g. 3.10] +- Other dependencies: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..3801fce --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,37 @@ +# Pull Request Template + +## Description + + +Fixes #(issue) + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [ ] Documentation update +- [ ] Refactor +- [ ] Other (please describe): + +## Checklist +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream modules + +## How Has This Been Tested? + + +- [ ] Test A +- [ ] Test B + +## Screenshots (if applicable) + + +## Additional Context + diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 35ae49b..948e93d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,42 +1,79 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Python application +name: Python Encoderize on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["**"] permissions: contents: read jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache pip + uses: actions/cache@v4 with: - python-version: "3.10" + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | + sudo apt-get update sudo apt-get install -y ghostscript python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install -e . - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Test with pytest - run: | - pytest + + lint_and_test: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y ghostscript + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -e . + + - name: Lint with flake8 + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Test with pytest and generate coverage + run: | + pytest --cov=. + coverage xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: DrWheelicus/encoderize \ No newline at end of file diff --git a/README.md b/README.md index 3e5bce0..bdc3f34 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# Name Visualizer +# Encoderize + +[![codecov](https://codecov.io/gh/DrWheelicus/encoderize/graph/badge.svg?token=QPQMGU1G01)](https://codecov.io/gh/DrWheelicus/encoderize) +[![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) +[![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) A Python package for generating various visual representations of text in SVG format. @@ -31,7 +35,7 @@ Generates SVG visualizations of text using various encoding methods: ## Usage ```bash -name-visualizer --text "HELLO" --output-dir output +encoderize --text "HELLO" --output-dir output ``` Options: @@ -67,7 +71,7 @@ pytest ## Requirements -- Python 3.6 or higher +- Python 3.8 or higher - svgwrite - treepoem diff --git a/name_visualizer/__init__.py b/encoderize/__init__.py similarity index 92% rename from name_visualizer/__init__.py rename to encoderize/__init__.py index 50dacfc..afdb230 100644 --- a/name_visualizer/__init__.py +++ b/encoderize/__init__.py @@ -18,6 +18,8 @@ Each visualization function takes text input and generates an SVG file. """ +__version__ = "0.1.0" + from .visualizers import ( generate_binary_stripe, generate_morse_code_band, @@ -42,10 +44,4 @@ 'generate_waveform_stripe', 'generate_chevron_stripe', 'generate_braille_stripe' -] - -""" -Name Visualizer package for generating various visual representations of text. -""" - -__version__ = "0.1.0" \ No newline at end of file +] \ No newline at end of file diff --git a/name_visualizer/cli.py b/encoderize/cli.py similarity index 97% rename from name_visualizer/cli.py rename to encoderize/cli.py index f7174e0..78991c7 100644 --- a/name_visualizer/cli.py +++ b/encoderize/cli.py @@ -1,5 +1,5 @@ """ -Command-line interface for the name_visualizer package. +Command-line interface for the encoderize package. """ import os diff --git a/name_visualizer/visualizers.py b/encoderize/visualizers.py similarity index 99% rename from name_visualizer/visualizers.py rename to encoderize/visualizers.py index 4388aa8..fb45f98 100644 --- a/name_visualizer/visualizers.py +++ b/encoderize/visualizers.py @@ -1,5 +1,5 @@ """ -Visualization functions for the name_visualizer module. +Visualization functions for the encoderize module. This module contains all the visualization functions that generate SVG representations of text using various encoding methods. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..96a2808 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools<=75.3.2; python_version == '3.8'", + "setuptools>=79.0.1; python_version > '3.8'", + "wheel" +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/pytest.ini b/pytest.ini index a44939c..52c816f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -17,7 +17,7 @@ addopts = --verbose --tb=short --showlocals - --cov=name_visualizer + --cov=encoderize --cov-report=term-missing --cov-report=html --no-cov-on-fail diff --git a/requirements.txt b/requirements.txt index d3fcece..1976fb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,16 @@ -setuptools -svgwrite -pillow -treepoem -pytest -pytest-mock -pytest-cov -pytest-asyncio \ No newline at end of file +build>=1.2.2.post1 +coverage>=7.6.1; python_version == "3.8" +coverage>=7.8.0; python_version >= "3.9" +docutils>=0.20.1; python_version == "3.8" +docutils>=0.21.2; python_version >= "3.9" +keyring>=25.5.0; python_version == "3.8" +keyring>=25.6.0; python_version >= "3.9" +pillow>=10.4.0; python_version == "3.8" +pillow>=11.2.1; python_version >= "3.9" +pytest>=8.3.5 +setuptools<=75.3.2; python_version == "3.8" +setuptools>=78.1.1; python_version >= "3.9" +svgwrite>=1.4.3 +treepoem>=3.24.0; python_version == "3.8" +treepoem>=3.27.1; python_version >= "3.9" +twine>=6.1.0 diff --git a/setup.py b/setup.py index 4b334a1..2fd5468 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ setup( name="encoderize", version="0.1.0", + keywords="encoderize, encoder, barcode, svg, visualizer", packages=find_packages(), install_requires=[ "svgwrite", @@ -20,9 +21,10 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], + license="MIT", entry_points={ 'console_scripts': [ - 'name-visualizer=name_visualizer.cli:main', + 'encoderize=encoderize.cli:main', ], }, ) \ No newline at end of file diff --git a/tests/test_cli.py b/tests/test_cli.py index 50ed737..cd43f27 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,5 @@ """ -Tests for the command-line interface of name_visualizer. +Tests for the command-line interface of encoderize. """ import os @@ -7,7 +7,7 @@ import unittest import pytest from unittest.mock import patch -from name_visualizer.cli import main +from encoderize.cli import main class TestCLI(unittest.TestCase): def setUp(self): diff --git a/tests/test_visualizers.py b/tests/test_visualizers.py index 622e9b1..8c0aa7b 100644 --- a/tests/test_visualizers.py +++ b/tests/test_visualizers.py @@ -1,5 +1,5 @@ """ -Tests for the visualization functions in name_visualizer. +Tests for the visualization functions in encoderize. """ import os @@ -7,7 +7,7 @@ import unittest import pytest import svgwrite -from name_visualizer import ( +from encoderize import ( generate_binary_stripe, generate_morse_code_band, generate_circuit_trace_silhouette,