diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 7da6f47..0000000 --- a/.flake8 +++ /dev/null @@ -1,11 +0,0 @@ -[flake8] -select = C,E,F,W,B,B950,B902 -ignore = E203, E501, W503 -max-line-length = 119 -max-complexity = 15 -exclude = - .git, - __pycache__, - build, - dist, - venv, \ No newline at end of file diff --git a/.gitignore b/.gitignore index 69ace67..17bc082 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,172 @@ -dist/* -build/* -__pycache__ -pygination.egg-info -venv \ No newline at end of file +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +.ruff_cache/ + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +#uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/latest/usage/project/#working-with-version-control +.pdm.toml +.pdm-python +.pdm-build/ + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# PyPI configuration file +.pypirc diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..c8cfe39 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/LICENSE.txt b/LICENSE.txt index 3754756..3065797 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ MIT License -Copyright (c) 2018 YOUR NAME +Copyright (c) 2025 enerBit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fac5f4a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "pygination" +version = "0.0.12" +description = "Simple pagination for pydantic models and SQLAlchemy Query objects" +readme = "README.md" +authors = [{ name = "Enerbit", email = "escribenos@enerbit.co" }] +requires-python = ">=3.7" +dependencies = ["SQLAlchemy", "pydantic"] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" +[tool.ruff] +line-length = 119 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e3992cc..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -SQLAlchemy -pydantic \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 9d5f797..0000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Inside of setup.cfg -[metadata] -description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index f3b2ced..0000000 --- a/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -"""A setuptools based setup module. - -See: -https://packaging.python.org/guides/distributing-packages-using-setuptools/ -""" - -# io.open is needed for projects that support Python 2.7 -# It ensures open() defaults to text mode with universal newlines, -# and accepts an argument to specify the text encoding -# Python 3 only projects can skip this import -from io import open -from os import path - -# Always prefer setuptools over distutils -from setuptools import find_packages, setup - - -VERSION = "0.0.12" -NAME = "pygination" -AUTHOR = "Enerbit" -AUTHOR_EMAIL = "escribenos@enerbit.co" -DESCRIPTION = "Simple pagination for pydantic models and SQLAlchemy Query objects" -PROJECT_URL = "https://github.com/enerbit/pygination" - -here = path.abspath(path.dirname(__file__)) - -# Get the long description from the README file -try: - with open(path.join(here, "README.md"), encoding="utf-8") as f: - long_description = "\n" + f.read() -except FileNotFoundError: - long_description = DESCRIPTION - -setup( - name=NAME, - version=VERSION, - description=DESCRIPTION, - long_description=long_description, - long_description_content_type="text/markdown", - url=PROJECT_URL, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - classifiers=[ - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - ], - keywords="python pagination", - package_dir={"": "src"}, - packages=find_packages(where="src"), # Required - package_data={NAME: ["py.typed"]}, - python_requires=">=3.7", - install_requires=["SQLAlchemy", "pydantic"], -)