Skip to content

Commit

Permalink
add typed packages to dev (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFlamm authored Jun 30, 2021
1 parent 6ffbfad commit 047dcd5
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions generate_phacc/generate_phacc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /usr/bin/env python

import pathlib
import re
import shutil
import os

Expand Down Expand Up @@ -75,13 +76,27 @@

with open(REQUIREMENTS_FILE, "r") as original_file:
data = original_file.readlines()



def is_test_requirement(requirement):
# if == not in d this is either a comment or unkown package, include
if "==" not in requirement:
return True

regex = re.compile('types-.+')
if re.match(regex, requirement):
return False

if d.split("==")[0] in requirements_remove:
return False

return True


new_data = []
removed_data = []
for d in data:
if "==" not in d:
new_data.append(d)
elif d.split("==")[0] not in requirements_remove:
if is_test_requirement(d):
new_data.append(d)
else:
removed_data.append(d)
Expand Down

0 comments on commit 047dcd5

Please sign in to comment.