Skip to content

Commit 00be453

Browse files
diegomarquezpddixit14
authored andcommitted
chore: add setup.py for library_generation (#2447)
Python sources in `library_generation` are imported via https://github.com/googleapis/sdk-platform-java/blob/c1ef755b4d73bdf8fdac6f86cb10834e920c9c43/library_generation/generate_repo.py#L17-L19 This `setup.py` can be used via `python -m pip install .` so running something like `cd library_generation && python generate_repo.py` can detect the `library_generation` _package_.
1 parent aae5f09 commit 00be453

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ target/
2222
.venv
2323

2424
# library generation
25-
output/
26-
library_generation/output/
27-
library_generation/test/output
28-
library_generation/test/googleapis
29-
library_generation/test/resources/integration/golden
30-
showcase/scripts/output/
25+
**/output/
26+
**/googleapis
27+
library_generation/test/**/golden*/
28+
library_generation/test/resources/test_repo_level_postprocess/
29+
**/*egg-info/
30+
**/build/

library_generation/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

library_generation/setup.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
Package information of library_generation python scripts
3+
"""
4+
5+
from setuptools import setup
6+
7+
setup(name='library_generation',
8+
version='0.1',
9+
package_dir={
10+
'library_generation': '.',
11+
},
12+
package_data={
13+
'library_generation': [
14+
'*.sh',
15+
'templates/*.j2',
16+
'gapic-generator-java-wrapper',
17+
'requirements.*',
18+
'owlbot/src/requirements.*',
19+
'owlbot/bin/*.sh',
20+
'owlbot/templates/**/*.j2',
21+
],
22+
}
23+
)

library_generation/test/integration_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def test_generate_repo(self):
108108
@classmethod
109109
def __pull_repo_to(cls, dest: Path, repo: str, committish: str):
110110
repo_url = f"{repo_prefix}/{repo}"
111+
print(f'Cloning repository {repo_url}')
111112
repo = Repo.clone_from(repo_url, dest)
112113
repo.git.checkout(committish)
113114

0 commit comments

Comments
 (0)