Skip to content

Commit e7becfd

Browse files
committed
feat/check-v update on the single hook file
1 parent 2b4efee commit e7becfd

File tree

15 files changed

+84
-52
lines changed

15 files changed

+84
-52
lines changed

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
with:
1818
python-version: '3.11'
1919
- name: install-dependencies
20-
run: pip install -r python-pypi-version-check/pypi_bumpversion_check/requirements.txt
20+
run: pip install -r hooks/pypi_bumpversion_check/requirements.txt
2121
- name: pre-commit-run
2222
uses: pre-commit/action@v3.0.0

.github/workflows/publish-to-pypi.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ __pycache__/
1212
# C extensions
1313
*.so
1414

15+
**/*.egg-info
16+
1517
# Distribution / packaging
1618
.Python
1719
build/

python-pypi-version-check/.pre-commit-config.yaml renamed to .pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
# https://www.checkov.io/4.Integrations/pre-commit.html
2525
# -----------------------------
2626
- repo: https://github.com/bridgecrewio/checkov.git
27-
rev: 3.2.145
27+
rev: 3.2.156
2828
hooks:
2929
- id: checkov
3030
# -----------------------------
@@ -66,7 +66,7 @@ repos:
6666
hooks:
6767
- id: install-pypi_bumpversion_check-requirements
6868
name: Install PYPI bumpversion check requirements
69-
entry: sh -c 'pip3 install -r python-pypi-version-check/pypi_bumpversion_check/requirements.txt && exit 0'
69+
entry: sh -c 'pip3 install -r ./hooks/pypi_bumpversion_check/requirements.txt && exit 0'
7070
language: system
7171
always_run: true
7272

@@ -77,5 +77,7 @@ repos:
7777
hooks:
7878
- id: pypi_bumpversion_check
7979
name: Check version
80-
entry: python3 -m pypi_bumpversion_check python-pypi-version-check/pyproject.toml
80+
args: ['./pyproject.toml']
81+
entry: python3 -m hooks.pypi_bumpversion_check
8182
language: system
83+
pass_filenames: false # Do not pass filenames to the hook (this is important to keep)

.pre-commit-hooks.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- id: python-pypi-version-check
3+
name: python-pypi-version-check
4+
description: Check if Python package already exists on PYPI.
5+
entry: python-pypi-version-check/pypi_bumpversion_check-check
6+
language: python
7+
8+
- id: python-pypi-version-check-test
9+
name: python-pypi-version-check
10+
description: Check if Python package already exists on PYPI.
11+
entry: python-pypi-version-check/pypi_bumpversion_check-check
12+
language: python
13+
14+
15+
# python-pypi-version-check-test /Users/hamed/Desktop/tucows-code/find-and-replace-strings/pyproject.toml
File renamed without changes.

hooks/pypi_bumpversion_check/__init__.py

Whitespace-only changes.

python-pypi-version-check/pypi_bumpversion_check/main.py renamed to hooks/pypi_bumpversion_check/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
#!/usr/bin/env python3
23
import argparse
34
import toml
45
import sys

python-pypi-version-check/pyproject.toml renamed to pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.setuptools]
6-
packages = ["pypi_bumpversion_check"]
6+
packages = { find = { where = ["."] } }
77

88
[project]
99
name = "python-pypi-version-check"
@@ -39,5 +39,6 @@ classifiers = [
3939
"Topic :: Utilities"
4040
]
4141

42-
[project.scripts]
43-
python-pypi-version-check = "pypi_bumpversion_check.__main__:main"
42+
[project.entry-points."console_scripts"]
43+
python-pypi-version-check = "hooks.pypi_bumpversion_check.main:main"
44+
python-pypi-version-check-test = "hooks.pypi_bumpversion_check.main:main"

python-pypi-version-check/.pre-commit-hooks.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

python-pypi-version-check/setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- coding: utf-8 -*-
2+
from setuptools import find_packages
3+
from setuptools import setup
4+
5+
6+
# setup(
7+
# name='python-pypi-version-check',
8+
# description='Pre-commit hooks for terraform_docs_replace',
9+
# url='https://github.com/opencepk/opencepk-lib-python-common',
10+
# version_format='{tag}+{gitsha}',
11+
12+
# author='Contributors',
13+
14+
# classifiers=[
15+
# "Programming Language :: Python",
16+
# "Programming Language :: Python :: 3",
17+
# "Programming Language :: Python :: 3 :: Only",
18+
# "Programming Language :: Python :: 3.6",
19+
# "Programming Language :: Python :: 3.7",
20+
# "Programming Language :: Python :: 3.8",
21+
# "Programming Language :: Python :: 3.9",
22+
# "Programming Language :: Python :: 3.10",
23+
# "Programming Language :: Python :: 3.11",
24+
# "Programming Language :: Python :: 3.12",
25+
# "Development Status :: 4 - Beta",
26+
# "Intended Audience :: Developers",
27+
# "Natural Language :: English",
28+
# "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
29+
# "Topic :: File Formats :: JSON",
30+
# "Topic :: Software Development :: Pre-processors",
31+
# "Topic :: Software Development :: Version Control :: Git",
32+
# "Topic :: Text Processing",
33+
# "Topic :: Text Processing :: Filters",
34+
# "Topic :: Text Processing :: General",
35+
# "Topic :: Utilities"
36+
# ],
37+
38+
# packages=find_packages(exclude=('tests*', 'testing*')),
39+
# install_requires=[
40+
# 'setuptools-git-version',
41+
# ],
42+
# entry_points={
43+
# 'console_scripts': [
44+
# 'python-pypi-version-check = hooks.pypi_bumpversion_check.main:main',
45+
# 'python-pypi-version-check-test = hooks.pypi_bumpversion_check.main:main'
46+
47+
# ],
48+
# },
49+
# )
50+
51+
52+
# python-pypi-version-check /Users/hamed/Desktop/tucows-code/find-and-replace-strings/pyproject.toml
53+
# This version is already published. Please bump the version in pyproject.toml.
54+
55+
56+
setup()

0 commit comments

Comments
 (0)