From f1de141ae62ece718e62b18f4059aa641388cf4d Mon Sep 17 00:00:00 2001 From: hasansezertasan Date: Sun, 24 Dec 2023 02:19:20 +0300 Subject: [PATCH] Hello World! :wave: --- .github/workflows/ci.yml | 21 +++++ LICENSE | 21 +++++ README.md | 18 ++++ pyproject.toml | 169 ++++++++++++++++++++++++++++++++++ src/fastui_admin/__about__.py | 4 + src/fastui_admin/__init__.py | 3 + tests/__init__.py | 3 + 7 files changed, 239 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pyproject.toml create mode 100644 src/fastui_admin/__about__.py create mode 100644 src/fastui_admin/__init__.py create mode 100644 tests/__init__.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..254bf6b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: + - main + tags: + - '**' + pull_request: + types: [opened, synchronize] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: '3.11' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dd6e264 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 to present Hasan Sezer Tasan + +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 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b531d36 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# FastUI Admin + +[![CI](https://github.com/hasansezertasan/FastUI-Admin/actions/workflows/ci.yml/badge.svg)](https://github.com/hasansezertasan/FastUI-Admin/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) +[![pypi](https://img.shields.io/pypi/v/fastui-admin.svg)](https://pypi.python.org/pypi/fastui-admin) +[![versions](https://img.shields.io/pypi/pyversions/fastui-admin.svg)](https://github.com/hasansezertasan/FastUI-Admin) +[![license](https://img.shields.io/github/license/hasansezertasan/FastUI-Admin.svg)](https://github.com/hasansezertasan/FastUI-Admin/blob/main/LICENSE) + +**Please note:** FastUI Admin is still an active work in progress, do not expect it to be complete. + +## Installation + +```console +pip install fastui-admin +``` + +## License + +`fastui-admin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b2ed9f8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,169 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "fastui-admin" +dynamic = ["version"] +description = 'Build better Admin UIs faster.' +readme = "README.md" +requires-python = ">=3.8" +license = "MIT" +keywords = [] +authors = [ + { name = "Hasan Sezer Taşan", email = "hasansezertasan@gmail.com" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Topic :: Internet", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + 'Programming Language :: Python :: 3 :: Only', + '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', + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Framework :: Pydantic :: 2", + "Framework :: FastAPI", +] +dependencies = ["pydantic[email]>=2.5.2"] + +[project.urls] +Documentation = "https://github.com/hasansezertasan/fastui-admin#readme" +Issues = "https://github.com/hasansezertasan/fastui-admin/issues" +Source = "https://github.com/hasansezertasan/fastui-admin" + +[project.optional-dependencies] +fastapi = [ + "fastapi>=0.104", + "python-multipart>=0.0.6", +] + + +[tool.hatch.version] +path = "src/fastui_admin/__about__.py" + +[tool.hatch.envs.default] +dependencies = [ + "coverage[toml]>=6.5", + "pytest", +] +[tool.hatch.envs.default.scripts] +test = "pytest {args:tests}" +test-cov = "coverage run -m pytest {args:tests}" +cov-report = [ + "- coverage combine", + "coverage report", +] +cov = [ + "test-cov", + "cov-report", +] + +[[tool.hatch.envs.all.matrix]] +python = ["3.7", "3.8", "3.9", "3.10", "3.11"] + +[tool.hatch.envs.lint] +detached = true +dependencies = [ + "black>=23.1.0", + "mypy>=1.0.0", + "ruff>=0.0.243", +] +[tool.hatch.envs.lint.scripts] +typing = "mypy --install-types --non-interactive {args:src/fastui_admin tests}" +style = [ + "ruff {args:.}", + "black --check --diff {args:.}", +] +fmt = [ + "black {args:.}", + "ruff --fix {args:.}", + "style", +] +all = [ + "style", + "typing", +] + +[tool.black] +target-version = ["py37"] +line-length = 120 +skip-string-normalization = true + +[tool.ruff] +target-version = "py37" +line-length = 120 +select = [ + "A", + "ARG", + "B", + "C", + "DTZ", + "E", + "EM", + "F", + "FBT", + "I", + "ICN", + "ISC", + "N", + "PLC", + "PLE", + "PLR", + "PLW", + "Q", + "RUF", + "S", + "T", + "TID", + "UP", + "W", + "YTT", +] +ignore = [ + # Allow non-abstract empty methods in abstract base classes + "B027", + # Allow boolean positional values in function calls, like `dict.get(... True)` + "FBT003", + # Ignore checks for possible passwords + "S105", "S106", "S107", + # Ignore complexity + "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", +] +unfixable = [ + # Don't touch unused imports + "F401", +] + +[tool.ruff.isort] +known-first-party = ["fastui_admin"] + +[tool.ruff.flake8-tidy-imports] +ban-relative-imports = "all" + +[tool.ruff.per-file-ignores] +# Tests can use magic values, assertions, and relative imports +"tests/**/*" = ["PLR2004", "S101", "TID252"] + +[tool.coverage.run] +source_pkgs = ["fastui_admin", "tests"] +branch = true +parallel = true +omit = [ + "src/fastui_admin/__about__.py", +] + +[tool.coverage.paths] +fastui_admin = ["src/fastui_admin", "*/fastui-admin/src/fastui_admin"] +tests = ["tests", "*/fastui-admin/tests"] + +[tool.coverage.report] +exclude_lines = [ + "no cov", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] diff --git a/src/fastui_admin/__about__.py b/src/fastui_admin/__about__.py new file mode 100644 index 0000000..2ebc096 --- /dev/null +++ b/src/fastui_admin/__about__.py @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2023-present hasansezertasan +# +# SPDX-License-Identifier: MIT +__version__ = "0.0.1" diff --git a/src/fastui_admin/__init__.py b/src/fastui_admin/__init__.py new file mode 100644 index 0000000..cf36e00 --- /dev/null +++ b/src/fastui_admin/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2023-present hasansezertasan +# +# SPDX-License-Identifier: MIT diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..cf36e00 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2023-present hasansezertasan +# +# SPDX-License-Identifier: MIT