Skip to content

Commit

Permalink
chore: add setup.py for library_generation (#2447)
Browse files Browse the repository at this point in the history
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_.
  • Loading branch information
diegomarquezp authored Feb 8, 2024
1 parent 47b632a commit 2f5a5c8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ target/
.venv

# library generation
output/
library_generation/output/
library_generation/test/output
library_generation/test/googleapis
library_generation/test/resources/integration/golden
showcase/scripts/output/
**/output/
**/googleapis
library_generation/test/**/golden*/
library_generation/test/resources/test_repo_level_postprocess/
**/*egg-info/
**/build/
1 change: 0 additions & 1 deletion library_generation/.gitignore

This file was deleted.

23 changes: 23 additions & 0 deletions library_generation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Package information of library_generation python scripts
"""

from setuptools import setup

setup(name='library_generation',
version='0.1',
package_dir={
'library_generation': '.',
},
package_data={
'library_generation': [
'*.sh',
'templates/*.j2',
'gapic-generator-java-wrapper',
'requirements.*',
'owlbot/src/requirements.*',
'owlbot/bin/*.sh',
'owlbot/templates/**/*.j2',
],
}
)
1 change: 1 addition & 0 deletions library_generation/test/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def test_generate_repo(self):
@classmethod
def __pull_repo_to(cls, dest: Path, repo: str, committish: str):
repo_url = f"{repo_prefix}/{repo}"
print(f'Cloning repository {repo_url}')
repo = Repo.clone_from(repo_url, dest)
repo.git.checkout(committish)

Expand Down

0 comments on commit 2f5a5c8

Please sign in to comment.