diff --git a/.gitignore b/.gitignore index c151cc7..9daf2ba 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,9 @@ dist/ docs/_build/ docs/modules.rst -docs/imagemuck*.rst +docs/fresnel_lens*.rst -imagemuck/openapi.yaml +fresnel_lens/openapi.yaml .vscode/ .idea/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b0178ab..d1d6e86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: name: reorder-python-imports entry: reorder-python-imports args: - - "--unclassifiable-application-module=imagemuck" + - "--unclassifiable-application-module=fresnel_lens" language: system types: [python] diff --git a/Makefile b/Makefile index 83e1878..dcc4f2e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -# ImageMuck makefile +# fresnel-lens makefile # You can set these variables from the command line -PROJECT = imagemuck +PROJECT = fresnel_lens .PHONY: help # Put it first so that "make" without argument is like "make help" diff --git a/README.md b/README.md index d0d6248..f9363ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# imagemuck +# fresnel-lens HTTP server for handling image uploads and thumbnail generation. diff --git a/docs/conf.py b/docs/conf.py index 3701af6..1e163e3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,7 @@ from pathlib import Path BASE_DIR = Path(__file__).parent.resolve() ABOUT = {} -with open(Path(BASE_DIR, "..", "imagemuck", "__about__.py")) as infile: +with open(Path(BASE_DIR, "..", "fresnel_lens", "__about__.py")) as infile: exec(infile.read(), ABOUT) diff --git a/docs/index.rst b/docs/index.rst index fe3ac50..5f53597 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,11 +1,11 @@ -ImageMuck -========= +Fresnel Lens +============ .. toctree:: :maxdepth: 2 :caption: Contents: - API Reference + API Reference diff --git a/imagemuck/__about__.py b/fresnel_lens/__about__.py similarity index 75% rename from imagemuck/__about__.py rename to fresnel_lens/__about__.py index 0cebfad..2ea1859 100644 --- a/imagemuck/__about__.py +++ b/fresnel_lens/__about__.py @@ -1,9 +1,9 @@ """Programatically accessible project metadata""" -__title__ = "imagemuck" +__title__ = "fresnel-lens" __version__ = "0.1.0" __authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"] __license__ = "MIT" __summary__ = "HTTP server for uploading images and generating thumbnails" -__url__ = "https://github.com/mocproject/imagemuck/" +__url__ = "https://github.com/enpaul/fresnel-lens/" diff --git a/imagemuck/__init__.py b/fresnel_lens/__init__.py similarity index 100% rename from imagemuck/__init__.py rename to fresnel_lens/__init__.py diff --git a/imagemuck/__main__.py b/fresnel_lens/__main__.py similarity index 92% rename from imagemuck/__main__.py rename to fresnel_lens/__main__.py index 25e3669..9fb3b23 100644 --- a/imagemuck/__main__.py +++ b/fresnel_lens/__main__.py @@ -1,12 +1,12 @@ """Development server stub entrypoint -Flask comes with a built-in development server. This entrypoint allows ``imagemuck`` +Flask comes with a built-in development server. This entrypoint allows ``fresnel_lens`` to be run directly to run the development server and expose some simple config options for ease of access. Run the below command to start the server: :: - python -m imagemuck + python -m fresnel_lens In addition to the helpful CLI flags, the Flask development server run by this module will also load any ``.env`` files in the current working directory when running the application. @@ -17,7 +17,7 @@ load any ``.env`` files in the current working directory when running the applic import argparse import sys -from imagemuck.application import APPLICATION +from fresnel_lens.application import APPLICATION # pylint: disable=invalid-name diff --git a/imagemuck/_server.py b/fresnel_lens/_server.py similarity index 77% rename from imagemuck/_server.py rename to fresnel_lens/_server.py index 6500686..94cfb3e 100644 --- a/imagemuck/_server.py +++ b/fresnel_lens/_server.py @@ -1,15 +1,16 @@ import flask -from imagemuck import __about__ -from imagemuck import configuration -from imagemuck import constants -from imagemuck import database -from imagemuck import exceptions -from imagemuck.resources import ResponseHeaders +from fresnel_lens import __about__ +from fresnel_lens import configuration +from fresnel_lens import constants +from fresnel_lens import database +from fresnel_lens import exceptions +from fresnel_lens.resources import ResponseHeaders def make_the_tea() -> None: """Just for fun + https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol """ if flask.request.content_type == "message/coffeepot": @@ -23,7 +24,7 @@ def initialize_database() -> None: database.initialize(flask.current_app.appconfig) -class ImageMuckRequest(flask.Request): +class FresnelRequest(flask.Request): """Extend the default Flask request object to add custom application state settings""" def make_response_headers(self) -> ResponseHeaders: @@ -46,8 +47,8 @@ class ImageMuckFlask(flask.Flask): There's probably an easier/more kosher way to do this, but ¯\\_(ツ)_/¯ """ - request_class = ImageMuckRequest + request_class = FresnelRequest def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.appconfig: configuration.ImageMuckConfig = configuration.load() + self.appconfig: configuration.FresnelConfig = configuration.load() diff --git a/imagemuck/application.py b/fresnel_lens/application.py similarity index 72% rename from imagemuck/application.py rename to fresnel_lens/application.py index 1dc615f..1d81a69 100644 --- a/imagemuck/application.py +++ b/fresnel_lens/application.py @@ -1,9 +1,9 @@ import flask_restful -from imagemuck import resources -from imagemuck._server import ImageMuckFlask -from imagemuck._server import initialize_database -from imagemuck._server import make_the_tea +from fresnel_lens import resources +from fresnel_lens._server import ImageMuckFlask +from fresnel_lens._server import initialize_database +from fresnel_lens._server import make_the_tea APPLICATION = ImageMuckFlask(__name__) diff --git a/imagemuck/configuration.py b/fresnel_lens/configuration.py similarity index 69% rename from imagemuck/configuration.py rename to fresnel_lens/configuration.py index f0e89fc..c8495a3 100644 --- a/imagemuck/configuration.py +++ b/fresnel_lens/configuration.py @@ -1,3 +1,5 @@ +import datetime +import enum import json import os from dataclasses import dataclass @@ -5,10 +7,20 @@ from dataclasses import field from pathlib import Path from typing import Any from typing import Dict +from typing import NamedTuple from typing import Optional +from typing import Sequence from typing import Tuple -from imagemuck import constants +import peewee + +from fresnel_lens import constants + + +class DimensionConfig(NamedTuple): + strategy: constants.DimensionStrategy + anchor: constants.Anchor + value: int def _default_sqlite_pragmas() -> Dict[str, Any]: @@ -31,7 +43,7 @@ def _default_sqlite_pragmas() -> Dict[str, Any]: @dataclass class _DBSqliteConfig: - path: Path = Path.cwd() / "imagemuck.db" + path: Path = Path.cwd() / "fresnel_lens.db" pragmas: Dict[str, Any] = field(default_factory=_default_sqlite_pragmas) @classmethod @@ -51,7 +63,7 @@ class _DBMariaConfig: username: str = "root" password: Optional[str] = None port: int = 3306 - schema: str = "imagemuck" + schema: str = "fresnel_lens" @classmethod def build(cls): @@ -67,52 +79,40 @@ class _DBMariaConfig: @dataclass class _DBConfig: - backend: constants.SupportedDatabaseBackend = ( - constants.SupportedDatabaseBackend.SQLITE - ) + backend: constants.DatabaseBackend = constants.DatabaseBackend.SQLITE sqlite: _DBSqliteConfig = field(default_factory=_DBSqliteConfig.build) mariadb: _DBMariaConfig = field(default_factory=_DBMariaConfig.build) @classmethod def build(cls): return cls( - backend=constants.SupportedDatabaseBackend[ - os.environ[constants.ENV_CONF_DB_BACKEND] - ] + backend=constants.DatabaseBackend[os.environ[constants.ENV_CONF_DB_BACKEND]] if constants.ENV_CONF_DB_BACKEND in os.environ else cls.backend ) @dataclass -class _UploadConfig: - - size_limit: int = 1 * 1024 * 1024 - formats: Tuple[str] = ("jpg", "jpeg") - - @classmethod - def build(cls): - return cls( - size_limit=(int(os.environ[constants.ENV_CONF_FS_UPLOAD_MAX_SIZE]) * 1024) - if constants.ENV_CONF_FS_UPLOAD_MAX_SIZE in os.environ - else cls.size_limit, - formats=( - item.strip().lower() - for item in os.environ[constants.ENV_CONF_FS_UPLOAD_FORMATS].split(",") - ) - if constants.ENV_CONF_FS_UPLOAD_MAX_SIZE in os.environ - else cls.formats, - ) +class ManipConfig: + alias: str + formats: Sequence[constants.ImageFormat] = ( + constants.ImageFormat.JPEG, + constants.ImageFormat.PNG, + ) + horizontal: None + vertical: None @dataclass class ImageMuckConfig: database: _DBConfig = field(default_factory=_DBConfig.build) - upload: _UploadConfig = field(default_factory=_UploadConfig.build) - storage_path: Path = Path.cwd() + images: Path = Path.cwd() / "images" + cache_dir: Path = Path.cwd() / "cache" + expose_source: bool = False + manips: Sequence[ManipConfig] = () @classmethod - def build(cls): + def from_env(cls): return cls( storage_path=Path( os.getenv(constants.ENV_CONF_FS_STORAGE_PATH, cls.storage_path) @@ -121,5 +121,4 @@ class ImageMuckConfig: def load() -> ImageMuckConfig: - - return ImageMuckConfig.build() + return ImageMuckConfig.from_env() diff --git a/fresnel_lens/constants.py b/fresnel_lens/constants.py new file mode 100644 index 0000000..34651d8 --- /dev/null +++ b/fresnel_lens/constants.py @@ -0,0 +1,29 @@ +import enum + +import peewee + + +class DatabaseBackend(enum.Enum): + MARIADB = peewee.MySQLDatabase + SQLITE = peewee.SqliteDatabase + + +class DimensionStrategy(enum.Enum): + CROP = enum.auto() + SCALE = enum.auto() + RELATIVE = enum.auto() + + +class ImageFormat(enum.Enum): + JPEG = ("jpg", "jpeg") + PNG = ("png",) + GIF = ("gif",) + + +class Anchor(enum.Enum): + C = "center" + + +HTTP_HEADER_RESPONSE_VERSION = "x-fresnel_lens-version" + +HTTP_HEADER_RESPONSE_DIGEST = "Digest" diff --git a/imagemuck/database/__init__.py b/fresnel_lens/database/__init__.py similarity index 80% rename from imagemuck/database/__init__.py rename to fresnel_lens/database/__init__.py index 02a6c16..c782feb 100644 --- a/imagemuck/database/__init__.py +++ b/fresnel_lens/database/__init__.py @@ -3,18 +3,18 @@ from typing import Tuple import peewee -from imagemuck import constants -from imagemuck.configuration import ImageMuckConfig -from imagemuck.database._shared import ImageMuckModel -from imagemuck.database._shared import INTERFACE as interface -from imagemuck.database.image import ImageRecord -from imagemuck.database.thumbnail import ThumbnailRecord +from fresnel_lens import constants +from fresnel_lens.configuration import FresnelConfig +from fresnel_lens.database._shared import FresnelModel +from fresnel_lens.database._shared import INTERFACE as interface +from fresnel_lens.database.image import ImageRecord +from fresnel_lens.database.thumbnail import ThumbnailRecord -MODELS: Tuple[ImageMuckModel, ...] = (ImageRecord, ThumbnailRecord) +MODELS: Tuple[FresnelModel, ...] = (ImageRecord, ThumbnailRecord) -def initialize(config: ImageMuckConfig): +def initialize(config: FresnelConfig): """Initialize the database interface Defining the database as an diff --git a/imagemuck/database/_shared.py b/fresnel_lens/database/_shared.py similarity index 90% rename from imagemuck/database/_shared.py rename to fresnel_lens/database/_shared.py index 54c81a8..670d38e 100644 --- a/imagemuck/database/_shared.py +++ b/fresnel_lens/database/_shared.py @@ -7,7 +7,7 @@ import peewee INTERFACE = peewee.DatabaseProxy() -class ImageMuckModel(peewee.Model): +class FresnelModel(peewee.Model): class Meta: # pylint: disable=too-few-public-methods,missing-class-docstring database = INTERFACE diff --git a/imagemuck/database/image.py b/fresnel_lens/database/image.py similarity index 91% rename from imagemuck/database/image.py rename to fresnel_lens/database/image.py index fdba6fd..4f584f5 100644 --- a/imagemuck/database/image.py +++ b/fresnel_lens/database/image.py @@ -4,10 +4,10 @@ from typing import List import peewee -from imagemuck.database._shared import ImageMuckModel +from fresnel_lens.database._shared import FresnelModel -class ImageRecord(ImageMuckModel): +class ImageRecord(FresnelModel): """Database record for""" width = peewee.IntegerField(null=False) diff --git a/imagemuck/database/thumbnail.py b/fresnel_lens/database/thumbnail.py similarity index 52% rename from imagemuck/database/thumbnail.py rename to fresnel_lens/database/thumbnail.py index 5da1aca..0e0f4d3 100644 --- a/imagemuck/database/thumbnail.py +++ b/fresnel_lens/database/thumbnail.py @@ -1,10 +1,10 @@ import peewee -from imagemuck.database._shared import ImageMuckModel -from imagemuck.database.image import ImageRecord +from fresnel_lens.database._shared import FresnelModel +from fresnel_lens.database.image import ImageRecord -class ThumbnailRecord(ImageMuckModel): +class ThumbnailRecord(FresnelModel): parent = peewee.ForeignKeyField(ImageRecord) width = peewee.IntegerField(null=False) diff --git a/imagemuck/exceptions.py b/fresnel_lens/exceptions.py similarity index 79% rename from imagemuck/exceptions.py rename to fresnel_lens/exceptions.py index c326bdd..d50dcad 100644 --- a/imagemuck/exceptions.py +++ b/fresnel_lens/exceptions.py @@ -2,13 +2,13 @@ :: - ImageMuckException + FresnelException +-- ClientError +-- ServerError """ -class ImageMuckException(Exception): +class FresnelException(Exception): """Whomp whomp, something went wrong But seriously, don't ever raise this exception @@ -17,7 +17,7 @@ class ImageMuckException(Exception): status: int -class ClientError(ImageMuckException): +class ClientError(FresnelException): """Error while processing client side input""" status = 400 @@ -29,7 +29,7 @@ class ImageResourceDeletedError(ClientError): status = 410 -class ServerError(ImageMuckException): +class ServerError(FresnelException): """Error while processing server side data""" status = 500 diff --git a/imagemuck/py.typed b/fresnel_lens/py.typed similarity index 100% rename from imagemuck/py.typed rename to fresnel_lens/py.typed diff --git a/fresnel_lens/resources/__init__.py b/fresnel_lens/resources/__init__.py new file mode 100644 index 0000000..9c45fad --- /dev/null +++ b/fresnel_lens/resources/__init__.py @@ -0,0 +1,19 @@ +from typing import Tuple + +from fresnel_lens.resources._shared import FresnelResource +from fresnel_lens.resources._shared import ResponseBody +from fresnel_lens.resources._shared import ResponseHeaders +from fresnel_lens.resources.image import Image +from fresnel_lens.resources.image import ImageUpload +from fresnel_lens.resources.openapi import OpenAPI +from fresnel_lens.resources.thumbnail import ThumbnailResize +from fresnel_lens.resources.thumbnail import ThumbnailScale + + +RESOURCES: Tuple[FresnelResource, ...] = ( + ImageUpload, + Image, + OpenAPI, + ThumbnailScale, + ThumbnailResize, +) diff --git a/imagemuck/resources/_shared.py b/fresnel_lens/resources/_shared.py similarity index 98% rename from imagemuck/resources/_shared.py rename to fresnel_lens/resources/_shared.py index 236bf77..c0f10a7 100644 --- a/imagemuck/resources/_shared.py +++ b/fresnel_lens/resources/_shared.py @@ -31,7 +31,7 @@ class ResponseTuple(NamedTuple): headers: ResponseHeaders -class ImageMuckResource(flask_restful.Resource): +class FresnelResource(flask_restful.Resource): """Extension of the default :class:`flask_restful.Resource` class Add a couple of useful things to the default resource class: diff --git a/imagemuck/resources/image.py b/fresnel_lens/resources/image.py similarity index 92% rename from imagemuck/resources/image.py rename to fresnel_lens/resources/image.py index 998d488..5c8d6e1 100644 --- a/imagemuck/resources/image.py +++ b/fresnel_lens/resources/image.py @@ -4,13 +4,13 @@ import uuid import flask -from imagemuck import constants -from imagemuck import database -from imagemuck import exceptions -from imagemuck.resources._shared import ImageMuckResource +from fresnel_lens import constants +from fresnel_lens import database +from fresnel_lens import exceptions +from fresnel_lens.resources._shared import FresnelResource -class ImageUpload(ImageMuckResource): +class ImageUpload(FresnelResource): routes = ("/image/",) @@ -45,7 +45,7 @@ class ImageUpload(ImageMuckResource): return None, 201 -class Image(ImageMuckResource): +class Image(FresnelResource): routes = ("/image/.jpeg",) diff --git a/imagemuck/resources/openapi.py b/fresnel_lens/resources/openapi.py similarity index 74% rename from imagemuck/resources/openapi.py rename to fresnel_lens/resources/openapi.py index 50b938d..afd3368 100644 --- a/imagemuck/resources/openapi.py +++ b/fresnel_lens/resources/openapi.py @@ -2,12 +2,12 @@ from pathlib import Path from ruamel.yaml import YAML -from imagemuck.resources._shared import ImageMuckResource +from fresnel_lens.resources._shared import FresnelResource yaml = YAML(typ="safe") -class OpenAPI(ImageMuckResource): +class OpenAPI(FresnelResource): routes = ("/openapi.json",) diff --git a/imagemuck/resources/thumbnail.py b/fresnel_lens/resources/thumbnail.py similarity index 70% rename from imagemuck/resources/thumbnail.py rename to fresnel_lens/resources/thumbnail.py index 1a79d0a..d9049cd 100644 --- a/imagemuck/resources/thumbnail.py +++ b/fresnel_lens/resources/thumbnail.py @@ -1,7 +1,7 @@ -from imagemuck.resources._shared import ImageMuckResource +from fresnel_lens.resources._shared import FresnelResource -class ThumbnailScale(ImageMuckResource): +class ThumbnailScale(FresnelResource): routes = ("/thumb//scale/.jpg",) @@ -9,7 +9,7 @@ class ThumbnailScale(ImageMuckResource): raise NotImplementedError -class ThumbnailResize(ImageMuckResource): +class ThumbnailResize(FresnelResource): routes = ("/thumb//size/x.jpg",) diff --git a/imagemuck/constants.py b/imagemuck/constants.py deleted file mode 100644 index c06f44a..0000000 --- a/imagemuck/constants.py +++ /dev/null @@ -1,34 +0,0 @@ -import enum - - -class SupportedDatabaseBackend(enum.Enum): - - MARIADB = enum.auto() - SQLITE = enum.auto() - - -HTTP_HEADER_RESPONSE_VERSION = "x-imagemuck-version" - -HTTP_HEADER_RESPONSE_DIGEST = "Digest" - -ENV_CONF_DB_BACKEND = "IMGMONK_DATABASE_BACKEND" - -ENV_CONF_DB_SQLITE_PATH = "IMGMONK_SQLITE_PATH" - -ENV_CONF_DB_SQLITE_PRAGMAS = "IMGMONK_SQLITE_PRAGMAS" - -ENV_CONF_DB_MARIA_HOSTNAME = "IMGMONK_MARIA_HOSTNAME" - -ENV_CONF_DB_MARIA_USERNAME = "IMGMONK_MARIA_USERNAME" - -ENV_CONF_DB_MARIA_PASSWORD = "IMGMONK_MARIA_PASSWORD" - -ENV_CONF_DB_MARIA_PORT = "IMGMONK_MARIA_PORT" - -ENV_CONF_DB_MARIA_SCHEMA = "IMGMONK_MARIA_SCHEMA" - -ENV_CONF_FS_STORAGE_PATH = "IMGMONK_STORAGE_PATH" - -ENV_CONF_FS_UPLOAD_MAX_SIZE = "IMGMONK_UPLOAD_LIMIT" - -ENV_CONF_FS_UPLOAD_FORMATS = "IMGMONK_UPLOAD_FORMATS" diff --git a/imagemuck/resources/__init__.py b/imagemuck/resources/__init__.py deleted file mode 100644 index a50ea37..0000000 --- a/imagemuck/resources/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Tuple - -from imagemuck.resources._shared import ImageMuckResource -from imagemuck.resources._shared import ResponseBody -from imagemuck.resources._shared import ResponseHeaders -from imagemuck.resources.image import Image -from imagemuck.resources.image import ImageUpload -from imagemuck.resources.openapi import OpenAPI -from imagemuck.resources.thumbnail import ThumbnailResize -from imagemuck.resources.thumbnail import ThumbnailScale - - -RESOURCES: Tuple[ImageMuckResource, ...] = ( - ImageUpload, - Image, - OpenAPI, - ThumbnailScale, - ThumbnailResize, -) diff --git a/openapi.yaml b/openapi.yaml index 60452ac..d05f39f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2,7 +2,7 @@ openapi: "3.0.2" info: version: 0.1.0 - title: ImageMuck + title: Fresnel Lens description: >- A simple HTTP service for mucking about with images. This is a super basic HTTP service for autogenerating website-ready banner and preview images from full-size @@ -198,10 +198,10 @@ components: data: {} headers: Version: - description: ImageMuck server application version + description: Application name and version schema: type: string - example: imagemuck-1.0.0 + example: fresnel-lens-1.0.0 Allowed: description: Comma delimited list of valid HTTP verbs schema: diff --git a/pyproject.toml b/pyproject.toml index 73f396b..3c593ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,17 @@ [tool.poetry] -name = "imagemuck" +name = "fresnel-lens" version = "0.1.0" license = "MIT" authors = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"] description = "HTTP server for uploading images and generating thumbnails" -repository = "https://github.com/mocproject/imagemuck/" +repository = "https://github.com/enpaul/fresnel-lens/" packages = [ - {include = "imagemuck"}, + {include = "fresnel_lens"}, {include = "tests", format = "sdist"} ] include = [ - "imagemuck/py.typed", - "imagemuck/openapi.yaml" + "fresnel_lens/py.typed", + "fresnel_lens/openapi.yaml" ] keywords = ["flask", "image", "thumbnail", "hosting"] readme = "README.md" diff --git a/tests/test_about.py b/tests/test_about.py index b74c783..47ebb97 100644 --- a/tests/test_about.py +++ b/tests/test_about.py @@ -3,7 +3,7 @@ from pathlib import Path import toml -from imagemuck import __about__ +from fresnel_lens import __about__ def test_about(): diff --git a/tests/test_openapi.py b/tests/test_openapi.py index 501f046..476857b 100644 --- a/tests/test_openapi.py +++ b/tests/test_openapi.py @@ -3,7 +3,7 @@ import importlib.resources import openapi_spec_validator import ruamel.yaml -from imagemuck import __about__ +from fresnel_lens import __about__ yaml = ruamel.yaml.YAML(typ="safe") # pylint: disable=invalid-name @@ -11,10 +11,10 @@ yaml = ruamel.yaml.YAML(typ="safe") # pylint: disable=invalid-name def test_openapi(): openapi_spec_validator.validate_spec( - yaml.load(importlib.resources.read_text("imagemuck", "openapi.yaml")) + yaml.load(importlib.resources.read_text("fresnel_lens", "openapi.yaml")) ) def test_openapi_version(): - spec = yaml.load(importlib.resources.read_text("imagemuck", "openapi.yaml")) + spec = yaml.load(importlib.resources.read_text("fresnel_lens", "openapi.yaml")) assert spec["info"]["version"] == __about__.__version__ diff --git a/tox.ini b/tox.ini index a672775..bb5401e 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ locked_deps = ruamel.yaml toml commands = - pytest --cov={envsitepackagesdir}/imagemuck --cov-config {toxinidir}/.coveragerc --cov-report term-missing {toxinidir}/tests/ + pytest --cov={envsitepackagesdir}/fresnel_lens --cov-config {toxinidir}/.coveragerc --cov-report term-missing {toxinidir}/tests/ [testenv:static] description = Static formatting and quality enforcement @@ -38,8 +38,8 @@ locked_deps = pylint commands = pre-commit run --all-files - pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/imagemuck/ - mypy --ignore-missing-imports --no-strict-optional {toxinidir}/imagemuck/ + pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/fresnel_lens/ + mypy --ignore-missing-imports --no-strict-optional {toxinidir}/fresnel_lens/ [testenv:static-tests] description = Static formatting and quality enforcement for the tests @@ -63,7 +63,7 @@ locked_deps = safety poetry commands = - bandit --recursive --quiet {toxinidir}/imagemuck/ + bandit --recursive --quiet {toxinidir}/fresnel_lens/ bandit --recursive --quiet --skip B101 {toxinidir}/tests/ poetry export --format requirements.txt --output {envtmpdir}/requirements.txt --without-hashes --dev safety check --bare --file {envtmpdir}/requirements.txt @@ -75,5 +75,5 @@ locked_deps = sphinx sphinx-autodoc-typehints commands = - sphinx-apidoc --no-toc --output-dir {toxinidir}/docs/ {toxinidir}/imagemuck/ + sphinx-apidoc --no-toc --output-dir {toxinidir}/docs/ {toxinidir}/fresnel_lens/ sphinx-build -W -b html {toxinidir}/docs/ {toxinidir}/docs/_build