Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Listar arquivo PO obsoletos#136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rffontenelle merged 9 commits into3.12fromadd-list-obsoletes
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions.github/scripts/list-obsolete.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# List PO files that no longer have a corresponding page in Python docs

import os
import os.path
import sys
import subprocess

def run(cmd):
return subprocess.check_output(cmd, shell=True, text=True)

# Set POT root directory from command-line argument or hardcoded, then test it
pot_root = 'cpython/Doc/locales/pot/'

if len(sys.argv) > 1:
pot_root = sys.argv[0]

if not os.path.isdir(pot_root):
print(f'Unable to find the POT directory {pot_root}')
exit(1)

# List PO files tracked by git
po_files = run('git ls-files | grep .po | tr "\n" " "').split()

# Compare po vs pot, store po without corresponding pot
to_remove = []
for file in sorted(po_files):
pot = os.path.join(pot_root, file + 't')
if not os.path.isfile(pot):
to_remove.append(file)

# Exit if no obsolete, or print obsoletes files.
# If running in GitHub Actions, add a problem matcher to bring up the attention
if len(to_remove) == 0:
exit
else:
matcher = ""
if 'CI' in os.environ:
matcher = '::error::'
print(f'{matcher}The following files are absent in the documentation, hence they should be removed:\n')
for file in to_remove:
print(f'{matcher} ' + file)
print("")
exit(1)
File renamed without changes.
26 changes: 23 additions & 3 deletions.github/workflows/check.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,8 @@ on:
- '3.12'
paths:
- '.github/workflows/check.yml'
- '.github/prepmsg.sh'
- '.github/scripts/prepmsg.sh'
- '.github/scripts/list-obsolete.py'
- 'Makefile'
- 'requirements.txt'
- '*.po'
Expand All@@ -20,7 +21,8 @@ on:
- '3.12'
paths:
- '.github/workflows/check.yml'
- '.github/prepmsg.sh'
- '.github/scripts/prepmsg.sh'
- '.github/scripts/list-obsolete.py'
- 'Makefile'
- 'requirements.txt'
- '*.po'
Expand DownExpand Up@@ -73,7 +75,7 @@ jobs:
- name: Prepare notification (only on error)
if: steps.build.outcome == 'failure'
id: prepare
run: .github/prepmsg.sh logs/build/err*.txt logs/notify.txt
run: .github/scripts/prepmsg.sh logs/build/err*.txt logs/notify.txt
env:
GITHUB_JOB: ${{ github.job }}
GITHUB_RUN_ID: ${{ github.run_id }}
Expand DownExpand Up@@ -205,3 +207,21 @@ jobs:
with:
name: compendium
path: compendium.po

# List PO files that no longer have a corresponding page in Python docs
list-obsolete:
runs-on: ubuntu-latest
steps:
- name: Check out ${{ github.repository }}
uses: actions/checkout@v4.1.1

- name: Set up Python 3
uses: actions/setup-python@v4.7.1
with:
python-version: '3'

- name: Generate POT files
run: make pot

- name: List obsolete PO files, if any
run: python3 .github/scripts/list-obsolete.py
35 changes: 0 additions & 35 deletionsdistutils/_setuptools_disclaimer.po
View file
Open in desktop

This file was deleted.

Loading

[8]ページ先頭

©2009-2025 Movatter.jp