apdev 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apdev
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Shared development tools for Python projects - character validation, circular import detection, and more
5
5
  Author-email: aipartnerup <tercel.yi@gmail.com>
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "apdev"
7
- version = "0.1.1"
7
+ version = "0.1.3"
8
8
  description = "Shared development tools for Python projects - character validation, circular import detection, and more"
9
9
  readme = "README.md"
10
10
  license = {text = "Apache-2.0"}
@@ -1,3 +1,3 @@
1
1
  """apdev - Shared development tools for Python projects."""
2
2
 
3
- __version__ = "0.1.1"
3
+ __version__ = "0.1.3"
@@ -4,7 +4,7 @@
4
4
  # Example: ./release.sh 0.2.0
5
5
  #
6
6
  # Auto-detects project name from pyproject.toml and GitHub repo from git remote.
7
- # Override with environment variables: PROJECT_NAME, GITHUB_REPO
7
+ # Override with environment variables: PROJECT_NAME, PACKAGE_NAME, GITHUB_REPO
8
8
 
9
9
  # Note: set -e is disabled to allow step-by-step execution
10
10
  # Individual steps will handle their own error handling
@@ -27,12 +27,17 @@ if [ -z "$PROJECT_NAME" ]; then
27
27
  fi
28
28
  fi
29
29
 
30
+ # Determine Python package (import) name
31
+ if [ -z "$PACKAGE_NAME" ]; then
32
+ PACKAGE_NAME="${PROJECT_NAME//-/_}"
33
+ fi
34
+
30
35
  # Auto-detect GitHub repo from git remote (unless set via env)
31
36
  if [ -z "$GITHUB_REPO" ]; then
32
37
  REMOTE_URL=$(git remote get-url origin 2>/dev/null)
33
38
  if [ -n "$REMOTE_URL" ]; then
34
39
  # Extract owner/repo from SSH or HTTPS URL
35
- GITHUB_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/](.+/.+?)(\.git)?$|\1|')
40
+ GITHUB_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
36
41
  fi
37
42
  if [ -z "$GITHUB_REPO" ]; then
38
43
  echo -e "${YELLOW}Warning: Could not detect GitHub repo from git remote${NC}"
@@ -71,9 +76,12 @@ check_tag_exists() {
71
76
  }
72
77
 
73
78
  check_pypi_uploaded() {
74
- # Check if version exists on PyPI (simple check via pip)
75
- # Use grep -w for exact word match to avoid partial matches like "0.13.0-dev"
76
- pip index versions "${PROJECT_NAME}" 2>/dev/null | grep -w "${VERSION}" > /dev/null 2>&1 && return 0 || return 1
79
+ # Check if version exists on PyPI
80
+ # Extract "Available versions:" line, split by comma, exact match
81
+ pip index versions "${PROJECT_NAME}" 2>/dev/null \
82
+ | grep "Available versions:" | sed 's/Available versions: //' \
83
+ | tr ',' '\n' | sed 's/[[:space:]]//g' \
84
+ | grep -xF "${VERSION}" > /dev/null 2>&1 && return 0 || return 1
77
85
  }
78
86
 
79
87
  check_release_exists() {
@@ -166,7 +174,7 @@ step1_version_verification() {
166
174
  INIT_VERSION=$(grep -E '^__version__ = ' src/${PROJECT_NAME}/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')
167
175
 
168
176
  echo -e " pyproject.toml: ${CYAN}${PYPROJECT_VERSION}${NC}"
169
- echo -e " __init__.py: ${CYAN}${INIT_VERSION}${NC}"
177
+ echo -e " __init__.py: ${CYAN}${INIT_VERSION}${NC}"
170
178
  echo -e " Script version: ${CYAN}${VERSION}${NC}"
171
179
 
172
180
  if [ "$PYPROJECT_VERSION" != "$VERSION" ] || [ "$INIT_VERSION" != "$VERSION" ]; then
@@ -207,8 +215,7 @@ step2_check_status() {
207
215
 
208
216
  # Check PyPI (optional, may fail if not installed)
209
217
  if command -v pip &> /dev/null; then
210
- # Use grep -w for exact word match to avoid partial matches like "0.13.0-dev"
211
- if pip index versions "${PROJECT_NAME}" 2>/dev/null | grep -w "${VERSION}" > /dev/null 2>&1; then
218
+ if pip index versions "${PROJECT_NAME}" 2>/dev/null | grep "Available versions:" | sed 's/Available versions: //' | tr ',' '\n' | sed 's/[[:space:]]//g' | grep -xF "${VERSION}" > /dev/null 2>&1; then
212
219
  STATUS_PYPI="${GREEN}✅${NC}"
213
220
  echo -e " PyPI Upload: ${STATUS_PYPI} Version ${VERSION} found on PyPI"
214
221
  else
@@ -650,9 +657,7 @@ step7_upload_pypi() {
650
657
  echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
651
658
 
652
659
  if command -v pip &> /dev/null; then
653
- # Use pip index versions and extract exact version match
654
- # grep -w ensures word boundary, preventing partial matches like "0.13.0-dev"
655
- if pip index versions "${PROJECT_NAME}" 2>/dev/null | grep -w "${VERSION}" > /dev/null 2>&1; then
660
+ if pip index versions "${PROJECT_NAME}" 2>/dev/null | grep "Available versions:" | sed 's/Available versions: //' | tr ',' '\n' | sed 's/[[:space:]]//g' | grep -xF "${VERSION}" > /dev/null 2>&1; then
656
661
  echo -e "${GREEN}✅ Version ${VERSION} already exists on PyPI${NC}"
657
662
  if ! ask_yn "Upload anyway? (will fail if version exists)" "n"; then
658
663
  SKIP_PYPI=true
@@ -721,7 +726,7 @@ step_summary() {
721
726
  echo -e " ${YELLOW}⚠️${NC} Package: Not built"
722
727
  fi
723
728
 
724
- if command -v pip &> /dev/null && pip index versions "${PROJECT_NAME}" 2>/dev/null | grep -w "${VERSION}" > /dev/null 2>&1; then
729
+ if command -v pip &> /dev/null && pip index versions "${PROJECT_NAME}" 2>/dev/null | grep "Available versions:" | sed 's/Available versions: //' | tr ',' '\n' | sed 's/[[:space:]]//g' | grep -xF "${VERSION}" > /dev/null 2>&1; then
725
730
  echo -e " ${GREEN}✅${NC} PyPI: https://pypi.org/project/${PROJECT_NAME}/${VERSION}/"
726
731
  else
727
732
  echo -e " ${YELLOW}⚠️${NC} PyPI: Not uploaded yet"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apdev
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Shared development tools for Python projects - character validation, circular import detection, and more
5
5
  Author-email: aipartnerup <tercel.yi@gmail.com>
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes