Skip to content

Commit

Permalink
Merge pull request #100 from FoamyGuy/include_pyproject_toml
Browse files Browse the repository at this point in the history
include pyproject.toml file in the bundle if it exists.
  • Loading branch information
tannewt authored Oct 31, 2023
2 parents 20b08fb + 86b6003 commit 34c259d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion circuitpython_build_tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ def library(library_path, output_directory, package_folder_prefix,

requirements_files = lib_path.glob("requirements.txt*")
requirements_files = [f for f in requirements_files if f.stat().st_size > 0]

toml_files = lib_path.glob("pyproject.toml*")
toml_files = [f for f in toml_files if f.stat().st_size > 0]
requirements_files.extend(toml_files)

if module_name and requirements_files and not example_bundle:
requirements_dir = pathlib.Path(output_directory).parent / "requirements"
if not os.path.isdir(requirements_dir):
Expand All @@ -316,7 +321,7 @@ def library(library_path, output_directory, package_folder_prefix,
total_size += 512
for filename in requirements_files:
full_path = os.path.join(library_path, filename)
output_file = os.path.join(requirements_subdir, "requirements.txt")
output_file = os.path.join(requirements_subdir, filename.name)
shutil.copyfile(full_path, output_file)

for filename in example_files:
Expand Down

0 comments on commit 34c259d

Please sign in to comment.