From 1ef5339012f7bfe58aa80b5830cc1781906ec8fd Mon Sep 17 00:00:00 2001 From: hminaee-tc Date: Thu, 13 Jun 2024 15:41:34 -0300 Subject: [PATCH 1/2] test toml file --- find-and-replace.py | 3 --- pyproject.toml | 41 +++++++++++++++++++++++++++++++++++++++++ setup.cfg | 40 ---------------------------------------- setup.py | 17 +++++++++++++++-- 4 files changed, 56 insertions(+), 45 deletions(-) delete mode 100644 find-and-replace.py create mode 100644 pyproject.toml delete mode 100644 setup.cfg diff --git a/find-and-replace.py b/find-and-replace.py deleted file mode 100644 index 1c18e6d..0000000 --- a/find-and-replace.py +++ /dev/null @@ -1,3 +0,0 @@ -# find-and-replace.py - -VERSION = '0.1.0' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..16d8f5c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools", "wheel"] + +[project] +name = "find-and-replace-strings" +version = "1.0.1" +description = "Python package and pre-commit-hook for finding and replacing string(s) in file(s)." +license = { text = "GPLv3" } +authors = [{name = "OpenCEPK Open Cloud Engineering Platform Kit", email = "opencepk@gmail.com"}] +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "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", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Topic :: File Formats :: JSON", + "Topic :: Software Development :: Pre-processors", + "Topic :: Software Development :: Version Control :: Git", + "Topic :: Text Processing", + "Topic :: Text Processing :: Filters", + "Topic :: Text Processing :: General", + "Topic :: Utilities" +] + +keywords = ["find", "replace", "string", "file", "pre-commit", "hook", "git", "tool", "utility", "opencepk"] + + +[project.scripts] +find-and-replace-strings = "find_and_replace.main:main" + + diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 092fc8e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,40 +0,0 @@ -[metadata] -name = find-and-replace-check -description = Python package and pre-commit-hook for finding and replacing string(s) in file(s). -version = attr: find-and-replace.VERSION -author = OpenCEPK Open Cloud Engineering Platform Kit -author_email = opencepk@gmail.com -license = GPLv3 -license_files = LICENSE -url = https://github.com/opencepk/find-and-replace -keywords = find, replace, string, file, pre-commit, hook, git, tool, utility, opencepk -classifiers = - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - 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 - Development Status :: 4 - Beta - Intended Audience :: Developers - Natural Language :: English - License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Topic :: File Formats :: JSON - Topic :: Software Development :: Pre-processors - Topic :: Software Development :: Version Control :: Git - Topic :: Text Processing - Topic :: Text Processing :: Filters - Topic :: Text Processing :: General - Topic :: Utilities - -[options] -python_requires = >=3.6 -packages = find: - -[options.entry_points] -console_scripts = - find-and-replace = find_and_replace.main:main diff --git a/setup.py b/setup.py index fc1f76c..e63c73a 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,16 @@ -from setuptools import setup +from setuptools import setup, find_packages -setup() \ No newline at end of file +setup( + name="find-and-replace-strings", + version="1.0.0", + description="Python package and pre-commit-hook for finding and replacing string(s) in file(s).", + author="OpenCEPK Open Cloud Engineering Platform Kit", + author_email="opencepk@gmail.com", + python_requires=">=3.7", + packages=find_packages(include=["find_and_replace", "find_and_replace.*"]), + entry_points={ + "console_scripts": [ + "find-and-replace-strings=find_and_replace.main:main", + ], + }, +) \ No newline at end of file From 4c8c282719eb0449f285316ab09a55863ad65739 Mon Sep 17 00:00:00 2001 From: hminaee-tc Date: Thu, 13 Jun 2024 17:16:49 -0300 Subject: [PATCH 2/2] fix exclusion --- .github/workflows/publish-to-pypi.yml | 6 ++++-- pyproject.toml | 20 ++++++++++++++++---- setup.py | 24 ++++++++++++------------ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index fe67b2c..668784c 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -24,13 +24,15 @@ jobs: python-version: 3.11 - name: Install twine - run: pip install twine + run: pip install twine bui - name: install setuptools run: pip install setuptools - name: Build the package - run: python setup.py sdist + run: python -m build - name: Publish the package run: twine upload --skip-existing --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_TOKEN }} ${{ github.workspace }}/dist/* + + diff --git a/pyproject.toml b/pyproject.toml index 16d8f5c..f2a9ca7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,25 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=61.0", "wheel"] + + + +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["find_and_replace"] [project] name = "find-and-replace-strings" -version = "1.0.1" +version = "1.0.3" description = "Python package and pre-commit-hook for finding and replacing string(s) in file(s)." license = { text = "GPLv3" } authors = [{name = "OpenCEPK Open Cloud Engineering Platform Kit", email = "opencepk@gmail.com"}] -requires-python = ">=3.7" +dependencies = [ + 'tomli; python_version < "3.11"', +] +requires-python = ">=3.9" + + classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", @@ -36,6 +48,6 @@ keywords = ["find", "replace", "string", "file", "pre-commit", "hook", "git", "t [project.scripts] -find-and-replace-strings = "find_and_replace.main:main" +find-and-replace-strings = "find_and_replace.__main__:main" diff --git a/setup.py b/setup.py index e63c73a..30a40ea 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,16 @@ from setuptools import setup, find_packages setup( - name="find-and-replace-strings", - version="1.0.0", - description="Python package and pre-commit-hook for finding and replacing string(s) in file(s).", - author="OpenCEPK Open Cloud Engineering Platform Kit", - author_email="opencepk@gmail.com", - python_requires=">=3.7", - packages=find_packages(include=["find_and_replace", "find_and_replace.*"]), - entry_points={ - "console_scripts": [ - "find-and-replace-strings=find_and_replace.main:main", - ], - }, + # name="find-and-replace-strings", + # version="1.0.0", + # description="Python package and pre-commit-hook for finding and replacing string(s) in file(s).", + # author="OpenCEPK Open Cloud Engineering Platform Kit", + # author_email="opencepk@gmail.com", + # python_requires=">=3.7", + # packages=find_packages(include=["find_and_replace", "find_and_replace.*"]), + # entry_points={ + # "console_scripts": [ + # "find-and-replace-strings=find_and_replace.main:main", + # ], + # }, ) \ No newline at end of file