From 84cd36f604546dfbfd3c1001101c1eb714907a04 Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Tue, 26 Dec 2023 12:50:55 +0100 Subject: [PATCH] chore: fix Pipfile --- Pipfile | 2 +- setup.py | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Pipfile b/Pipfile index 1daa150..b0025cb 100644 --- a/Pipfile +++ b/Pipfile @@ -23,7 +23,7 @@ python_version = "3.12" [scripts] black = "black ." -build = "python setup.py sdist bdist_wheel" +build = "python -m build --sdist --wheel --outdir dist --no-isolation" upload = "twine upload dist/*" version="semantic-release version" publish = "semantic-release publish" diff --git a/setup.py b/setup.py index ecf990c..4a47346 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,17 @@ -from setuptools import setup, find_packages +import shutil +from pathlib import Path +from typing import Any + +from setuptools import find_packages, setup version = "2.0.9" +requirements = Path("requirements.txt") +readme = Path("README.md") + -def classification_dependencies(): - with open("requirements.txt") as f: +def classification_dependencies() -> tuple[list[Any], list[Any]]: + with requirements.open("r", encoding="UTF-8") as f: external = [] internal = [] for package in f.read().splitlines(): @@ -15,11 +22,15 @@ def classification_dependencies(): return external, internal -with open("README.md", "r", encoding="utf-8") as fh: +with readme.open("r", encoding="utf-8") as fh: long_description = fh.read() external, internal = classification_dependencies() +# remove old dist version + +shutil.rmtree("dist", ignore_errors=True) + setup( name="mkdocs_embed_file_plugins", python_requires=">=3.7", @@ -38,15 +49,10 @@ def classification_dependencies(): "Topic :: Text Processing :: Markup :: Markdown", "License :: OSI Approved :: GNU Affero General Public License v3 or later" " (AGPLv3+)", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", ], long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/Mara-Li/mkdocs_embed_file_plugins", + url="https://github.com/ObsidianPublisher/mkdocs-embed_file-plugin", entry_points={ "mkdocs.plugins": ["embed_file=mkdocs_embed_file_plugins.plugin:EmbedFile"] },