==> ./contents <== ==> ./setup.cfg <== # flake8 doesn't support pyproject.toml yet: # https://github.com/PyCQA/flake8/issues/234 [flake8] exclude = setup.py,venv,build,dist max-line-length = 88 ==> ./.gitignore <== # Python __pycache__/ # Files created by this set up: venv/ build/ dist/ *.egg-info/ .pytest_cache/ .mypy_cache/ ==> ./Makefile <== all: run clean: rm -rf venv build dist .pytest_cache .mypy_cache *.egg-info venv: python3 -m venv venv && \ venv/bin/pip install --upgrade pip setuptools && \ venv/bin/pip install --editable ".[dev]" run: venv venv/bin/flask --app scipaperloader --debug run format: venv venv/bin/black . && venv/bin/isort . format-check: venv venv/bin/black --check . && venv/bin/isort --check . lint: venv venv/bin/flake8 . mypy: venv venv/bin/mypy test: venv venv/bin/pytest dist: venv format-check lint mypy test venv/bin/pip wheel --wheel-dir dist --no-deps . ==> ./pyproject.toml <== [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "scipaperloader" version = "1.0.0" requires-python = ">=3.8.1,<4" dependencies = [ "Flask>=3.0.2,<4", ] [project.optional-dependencies] dev = [ "pytest>=8,<9", "flake8>=7,<8", "black>=24.2.0,<25", "isort>=5.13.1,<6", "mypy>=1.8.0,<2", ] [tool.setuptools.package-data] "*" = ["**/static/**/*", "**/templates/**/*"] [tool.pytest.ini_options] testpaths = ["tests"] [tool.black] line-length = 88 [tool.isort] profile = "black" [tool.mypy] ignore_missing_imports = true files = "scipaperloader,tests" ==> ./tests/test_scipaperloader.py <== import pytest from scipaperloader import create_app @pytest.fixture def app(): app = create_app({"TESTING": True}) # set up here yield app # tear down here @pytest.fixture def client(app): return app.test_client() def test_index(client): response = client.get("/") assert b"It works!" in response.data ==> ./scipaperloader/templates/index.html <==
The development environment is now set up and you can start coding! Check
out the README.md
for the development environment usage.
If you are new to Flask, both Quickstart and Tutorial are great resources to get up and running quickly.
Check out Flask documentation for more patterns such as using SQL DB or Mongo DB, making a single-page application and many more features.
When you are ready to deploy, you may want to consider these:
SECRET_KEY
in production.