diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95453ec..4bc6ef5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ '3.8', '3.9', '3.10' ] + python-version: [ '3.10', '3.11', '3.12', '3.13' ] steps: - name: Checkout @@ -27,9 +27,14 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Run linting + run: | + make lint + - name: Run tests run: | make test-coverage + - name: Coveralls Parallel uses: coverallsapp/github-action@master with: diff --git a/Makefile b/Makefile index a5a7b30..dc53196 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,8 @@ VENV_RUN = . $(VENV_ACTIVATE) venv: $(VENV_ACTIVATE) -$(VENV_ACTIVATE): setup.cfg setup.py pyproject.toml +$(VENV_ACTIVATE): pyproject.toml test -d $(VENV_DIR) || $(VENV_BIN) $(VENV_DIR) - $(VENV_RUN); pip install --upgrade setuptools wheel $(VENV_RUN); pip install -e ".[dev]" touch $(VENV_DIR)/bin/activate @@ -16,26 +15,30 @@ clean: rm -rf build/ rm -rf .eggs/ rm -rf *.egg-info/ + rm -rf .venv + +clean-dist: clean rm -rf dist/ -clean-venv: - rm -rf .venv +lint: venv + $(VENV_RUN); python -m ruff check . -format: - $(VENV_RUN); python -m isort .; python -m black . +format: venv + $(VENV_RUN); python -m ruff format . && python -m ruff check . --fix test: venv - $(VENV_RUN); python -m pytest tests + $(VENV_RUN); python -m pytest test-coverage: venv $(VENV_RUN); coverage run --source=verdin -m pytest tests && coverage lcov -o .coverage.lcov -install: venv - dist: venv - $(VENV_RUN); python setup.py sdist bdist_wheel + $(VENV_RUN); python -m build + +install: venv + $(VENV_RUN); pip install -e . upload: venv $(VENV_RUN); pip install --upgrade twine; twine upload dist/* -.PHONY: clean venv-clean format +.PHONY: clean clean-dist format test test-coverage upload diff --git a/README.md b/README.md index 647e87e..923fb8e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Install Requirements ------------ -Python 3.8+ +Python 3.10+ Usage ----- diff --git a/pyproject.toml b/pyproject.toml index c6cf2ee..55d8dee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,50 @@ # Verdin project configuration [build-system] -requires = ['setuptools', 'wheel'] -build-backend = "setuptools.build_meta" +requires = ['hatchling'] +build-backend = "hatchling.build" -[tool.black] -line_length = 100 -include = '((verdin)/.*\.py$|tests/.*\.py$)' -#extend_exclude = '()' +[project] +name = "verdin" +authors = [ + { name = "Thomas Rausch", email = "info@localstack.cloud" } +] +description = "A Python SDK for Tinybird" +readme = "README.md" +license = "Apache-2.0" +classifiers = [ + "Development Status :: 4 - Beta", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: System :: Networking", + "Topic :: Software Development :: Libraries", + "Topic :: Utilities" +] +requires-python = ">=3.10" +dynamic = ["version"] + +[project.urls] +Repository = "https://github.com/localstack/verdin" + +[project.optional-dependencies] +dev = [ + "pytest>=6.2.4", + "ruff==0.9.1", + "pytest_httpserver>=1.0.1", + "coverage[toml]>=5.0", + "pytest-cov>=2.7.1", + "coveralls", +] + +[tool.hatch.version] +path = "verdin/__init__.py" -[tool.isort] -profile = 'black' -#extend_skip = [] -line_length = 100 +[tool.ruff] +line-length = 100 +target-version = "py310" [tool.coverage.run] relative_files = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fbc755e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,45 +0,0 @@ -[metadata] -name = verdin -version = attr: verdin.__version__ -url = https://github.com/localstack/verdin -author = Thomas Rausch -author_email = thomas@localstack.cloud -description = A Python SDK for Tinybird -long_description = file: README.md -long_description_content_type = text/markdown; charset=UTF-8 -license = Apache License 2.0 -classifiers = - Development Status :: 4 - Beta - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Topic :: System :: Networking - -[options] -zip_safe = False -packages = find: - -install_requires = - requests>=2.20.0 - -[options.extras_require] -dev = - pytest>=6.2.4 - black>=22.1 - isort>=5.10.1 - pytest_httpserver>=1.0.1 - coverage[toml]>=5.0 - pytest-cov>=2.7.1 - coveralls - -[options.packages.find] -exclude = - tests* - -[options.package_data] -* = *.md - diff --git a/setup.py b/setup.py deleted file mode 100644 index c823345..0000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup - -setup()