diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c798f3e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build Test +on: + push: + pull_request: + +jobs: + build-test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.12"] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build twine + + - name: Build package + run: | + python -m build + + - name: Check package with twine + run: | + twine check dist/* + + - name: Test installation + run: | + python -m pip install dist/*.whl + + - name: Verify installation + run: | + python -c "from flask_stupe import schema_required" diff --git a/pyproject.toml b/pyproject.toml index 3f3ed23..487be6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,50 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "Flask-Stupe" +version = "4.4.0" +description = "a.k.a. « Flask on steroids »" +readme = "README.rst" +authors = [ + {name = "Guillaume Gelin"} +] +license = {text = "MIT"} +classifiers = [ + "Environment :: Web Environment", + "Intended Audience :: Developers", + "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", + "Programming Language :: Python :: 3.12", + "Topic :: Internet :: WWW/HTTP :: Dynamic Content", + "Topic :: Software Development :: Libraries :: Python Modules" +] +dependencies = [ + "flask==2.1.3", + "pymongo==4.2.0", + "werkzeug==2.2.2", + "marshmallow==3.17.0", + "python-dateutil==2.9.0.post0", +] + +[project.urls] +Homepage = "https://github.com/numberly/flask-stupe" + +[tool.setuptools] +packages = ["flask_stupe"] +include-package-data = true +zip-safe = false +platforms = ["any"] + +[tool.pytest.ini_options] +testpaths = ["tests"] +python_files = "test_*.py" + [tool.commitizen] name = "cz_conventional_commits" tag_format = "$version" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 48d2beb..0000000 --- a/setup.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[bdist_wheel] -universal = 1 - -[tool:pytest] -testpaths = tests -python_files = *.py -addopts = -vv --capture=no --showlocals --cov-report term-missing --cov flask_stupe --no-cov-on-fail --cov-fail-under 100 - -[flake8] -ignore = E125,E129,W503 -exclude = .venv,.git,src/ - -[isort] -line_length = 79 -indent=' ' -multi_line_output = 0 -skip = .venv/,.git/,src/ -known_first_party = flask_stupe,tests diff --git a/setup.py b/setup.py deleted file mode 100644 index 341e4a3..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -# encoding: utf-8 -try: - from setuptools import setup -except ImportError: - # For Python 3.12+, setuptools is no longer in stdlib - import sys - print("Error: setuptools is required but not found.") - print("Please install setuptools package using:") - print("pip install setuptools") - sys.exit(1) - - -def get_description(): - with open("README.rst") as file: - return file.read() - - -setup( - name='Flask-Stupe', - version='4.4.0', - url='https://github.com/numberly/flask-stupe', - license='MIT', - author='Guillaume Gelin', - author_email='1m_rtb_devops@numberly.com', - description='a.k.a. « Flask on steroids »', - long_description=get_description(), - packages=['flask_stupe'], - include_package_data=True, - zip_safe=False, - platforms='any', - python_requires='>=3.8', - classifiers=[ - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - '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', - 'Programming Language :: Python :: 3.12', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - 'Topic :: Software Development :: Libraries :: Python Modules' - ] -)