Merge branch '1-actually-do-something' into 'master'
Resolve "Actually do something" Closes #1 See merge request bslathi19/rtl-manifest!1
This commit is contained in:
@@ -1,7 +1,34 @@
|
|||||||
image: python:latest
|
image: python:latest
|
||||||
|
|
||||||
run:
|
stages:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
rules:
|
||||||
|
- when: always
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- ./dist
|
||||||
script:
|
script:
|
||||||
- source init_env.sh
|
- source init_env.sh
|
||||||
- python -m build
|
- python -m build
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
rules:
|
||||||
|
- when: always
|
||||||
|
script:
|
||||||
|
- echo "Haha no tests yet"
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
stage: deploy
|
||||||
|
rules:
|
||||||
|
# only run on MRs to main
|
||||||
|
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
|
||||||
|
# run on commits to main
|
||||||
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
|
script:
|
||||||
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${PACKAGE_PROJECT_ID}/packages/pypi dist/*
|
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${PACKAGE_PROJECT_ID}/packages/pypi dist/*
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ name = "rtl-manifest" # REQUIRED, is the only field that cannot be marked as dy
|
|||||||
#
|
#
|
||||||
# For a discussion on single-sourcing the version, see
|
# For a discussion on single-sourcing the version, see
|
||||||
# https://packaging.python.org/guides/single-sourcing-package-version/
|
# https://packaging.python.org/guides/single-sourcing-package-version/
|
||||||
version = "0.0.1" # REQUIRED, although can be dynamic
|
version = "0.0.2" # REQUIRED, although can be dynamic
|
||||||
|
|
||||||
# This is a one-line description or tagline of what your project does. This
|
# This is a one-line description or tagline of what your project does. This
|
||||||
# corresponds to the "Summary" metadata field:
|
# corresponds to the "Summary" metadata field:
|
||||||
|
|||||||
@@ -1,4 +1,39 @@
|
|||||||
|
|
||||||
|
import argparse
|
||||||
|
from typing import List
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
|
||||||
def rtl_manifest_main():
|
def rtl_manifest_main():
|
||||||
print("Hello, world!")
|
parser = argparse.ArgumentParser(
|
||||||
pass
|
prog='rtl-manifest',
|
||||||
|
description='Read in sources.list files and return a string of all source files',
|
||||||
|
epilog='Made by Byron Lathi')
|
||||||
|
|
||||||
|
parser.add_argument("source")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
files = read_sources(args.source)
|
||||||
|
|
||||||
|
for file in files:
|
||||||
|
print(file, end = " ")
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
def read_sources(source_file: str) -> List[str]:
|
||||||
|
files = []
|
||||||
|
base_dir = pathlib.Path(source_file).parent
|
||||||
|
|
||||||
|
|
||||||
|
with open(source_file, "r") as file:
|
||||||
|
for line in file:
|
||||||
|
path = line.strip()
|
||||||
|
if (path.endswith("sources.list")):
|
||||||
|
new_path = pathlib.Path(base_dir) / path
|
||||||
|
for recursive_path in read_sources(new_path):
|
||||||
|
files.append(recursive_path)
|
||||||
|
else:
|
||||||
|
abs_path = pathlib.Path(base_dir / path).absolute()
|
||||||
|
files.append(str(abs_path))
|
||||||
|
|
||||||
|
return files
|
||||||
2
test/sources.list
Normal file
2
test/sources.list
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
src/sub/submodule/sources.list
|
||||||
|
src/example.sv
|
||||||
0
test/src/example.sv
Normal file
0
test/src/example.sv
Normal file
0
test/src/sub/submodule/other_submodule.sv
Normal file
0
test/src/sub/submodule/other_submodule.sv
Normal file
2
test/src/sub/submodule/sources.list
Normal file
2
test/src/sub/submodule/sources.list
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
other_submodule.sv
|
||||||
|
submodule_regs.rdl
|
||||||
0
test/src/sub/submodule/submodule.sv
Normal file
0
test/src/sub/submodule/submodule.sv
Normal file
0
test/src/sub/submodule/submodule_regs.rdl
Normal file
0
test/src/sub/submodule/submodule_regs.rdl
Normal file
Reference in New Issue
Block a user