diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5da51cf..894d465 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -15,5 +15,6 @@ jobs: ci: uses: community-of-python/community-workflow/.github/workflows/preset.yml@main with: - python-version: '["3.10", "3.12","3.13"]' + python-version: '["3.10","3.11","3.12","3.13"]' + os: '["ubuntu-latest"]' secrets: inherit diff --git a/.gitignore b/.gitignore index c9b4526..e7c7486 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ uv.lock .mypy_cache .ruff_cache __pycache__ +.idea diff --git a/Justfile b/Justfile index 3877e97..51148c6 100644 --- a/Justfile +++ b/Justfile @@ -21,5 +21,6 @@ test *args: publish: rm -rf dist + uv version $GITHUB_REF_NAME uv build uv publish --token $PYPI_TOKEN diff --git a/pyproject.toml b/pyproject.toml index a83a86c..a42df8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ classifiers = [ "Typing :: Typed", ] authors = [{ name = "community-of-python" }] -dynamic = ["version"] +version = "0" requires-python = ">=3.10" dependencies = [ "httpx", @@ -31,11 +31,12 @@ dev = ["anyio", "faker", "pytest", "pytest-cov"] lint = [{ include-group = "dev" }, "auto-typing-final", "mypy", "ruff"] [build-system] -requires = ["hatchling", "hatch-vcs"] -build-backend = "hatchling.build" +requires = ["uv_build"] +build-backend = "uv_build" -[tool.hatch.version] -source = "vcs" +[tool.uv.build-backend] +module-name = "safe_s3_storage" +module-root = "" [tool.ruff] fix = true diff --git a/safe_s3_storage/file_validator.py b/safe_s3_storage/file_validator.py index b43adb6..20c7312 100644 --- a/safe_s3_storage/file_validator.py +++ b/safe_s3_storage/file_validator.py @@ -60,6 +60,7 @@ def _validate_mime_type(self, *, file_name: str, file_content: bytes) -> str: mime_type = "text/plain" if mime_type in self.allowed_mime_types: return mime_type + raise exceptions.NotAllowedMimeTypeError( file_name=file_name, mime_type=mime_type, allowed_mime_types=self.allowed_mime_types )