Skip to content

Commit

Permalink
chore: testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
salman2013 committed Apr 19, 2024
1 parent be4e10e commit c6fcab9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions requirements/edx/testing.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ unidiff # Required by coverage_pytest_plugin
pylint-pytest==0.3.0 # A Pylint plugin to suppress pytest-related false positives.
pact-python # Library for contract testing
py # Needed for pytest configurations, was previously been fetched through tox
requirements-parser
41 changes: 20 additions & 21 deletions scripts/find_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import json
import os
import re
import requirements
import shlex
import shutil
import subprocess
Expand Down Expand Up @@ -195,30 +196,28 @@ def process_directory():
Also copies the considered dependencies file into the temp work directory,
for later analysis.
"""

repo_name = Path.cwd().name
repo_work = WORK_DIR / repo_name
repo_work.mkdir(parents=True, exist_ok=True)
repo_urls = set()
package_names = []
openedx_packages = []

with open("/tmp/unpack_reqs/openedx/edx-platform/base.txt") as fbase:
# Read each line (package name) in the file
file_data = fbase.read()

# Splitting the data by lines
lines = file_data.strip().split('\n')
for line in lines:
# Print the package name
parts = line.split('#', 1)
package_name = parts[0].strip()
package_names.append(package_name)

for package in package_names:
if package != " ":
home_page = request_package_info_url(package)
if home_page is not None:
if match := urls_in_orgs([home_page], SECOND_PARTY_ORGS):
openedx_packages.append(home_page)

if (js_reqs := Path("package-lock.json")).exists():
shutil.copyfile(js_reqs, repo_work / "package-lock.json")

if (py_reqs := find_py_reqs()):
shutil.copyfile(py_reqs, repo_work / "base.txt")

with open(repo_work / "base.txt") as fbase:
# Read each line (package name) in the file
# with open('requirements.txt', 'r') as fd:
for req in requirements.parse(fbase):
print(req.name)
home_page = request_package_info_url(req.name)
if home_page is not None:
if match := urls_in_orgs([home_page], SECOND_PARTY_ORGS):
openedx_packages.append(home_page)

return openedx_packages

FIRST_PARTY_ORGS = ["openedx"]
Expand Down

0 comments on commit c6fcab9

Please sign in to comment.