Skip to content

Commit

Permalink
ensure we update credits.md when updating software info
Browse files Browse the repository at this point in the history
  • Loading branch information
cockroacher committed Nov 1, 2024
1 parent 3320de6 commit 1ae5efd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/update-software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
advisories
- name: Verifing Software(s)
run: python update_software.py -d ${{ secrets.GITHUB_TOKEN }}
- name: Update CREDITS.md
run: python default.py --uc
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
Expand All @@ -70,10 +72,12 @@ jobs:
- software-full.json
- defaults/software-rules.json
- defaults/settings.json
- CREDITS.md
assignees: 7h3Rabbit
reviewers: 7h3Rabbit
add-paths: |
software-sources.json
software-full.json
defaults/software-rules.json
defaults/settings.json
CREDITS.md
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,10 @@ Why not look at third parties.



# Credits

We could not do this without all help from contributors and other projects we use.

[Read more about them under credits](./CREDITS.md)


17 changes: 15 additions & 2 deletions helpers/credits_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def update_credits_markdown(global_translation):

base_directory = os.path.join(Path(os.path.dirname(
os.path.realpath(__file__)) + os.path.sep).parent)
credits_path = os.path.join(base_directory, 'credits.md')
credits_path = os.path.join(base_directory, 'CREDITS.md')

with open(credits_path, 'w', encoding='utf-8', newline='') as file:
file.write(creds)
Expand Down Expand Up @@ -44,7 +44,6 @@ def get_credits(global_translation):
data = json.load(json_input_file)
text += '\r\n'
for creditor_name, creditor_version in data['dependencies'].items():
print(creditor_name)
if creditor_name not in softwares:
print(f'{creditor_name} not found in {software_full_path}.')
continue
Expand Down Expand Up @@ -76,6 +75,20 @@ def get_credits(global_translation):
for _, match in enumerate(matches, start=1):
name = match.group('name').strip()
text += f'## [{name}](https://pypi.org/project/{name}/)\r\n'
if 'beautifulsoup4' in name:
text += 'Usage: Used to parse HTML content\r\n'
elif 'lxml' in name:
text += 'Usage: Used to parse XML content\r\n'
elif 'requests' in name:
text += 'Usage: Used to request content not normally requested by users, like robots.txt\r\n'
elif 'urllib3' in name:
text += 'Usage: Used to parse url\r\n'
elif 'dnspython' in name:
text += 'Usage: Used to get and parse DNS content\r\n'
elif 'IP2Location' in name:
text += 'Usage: Used to get a proximate location related to IP/IP-range\r\n'
elif 'packaging' in name:
text += 'Usage: Used to understand and compare software versions\r\n'

text += get_external_information_sources()
return text
Expand Down

0 comments on commit 1ae5efd

Please sign in to comment.