Skip to content

Commit accfe1d

Browse files
Googlerpiotrwrotniak
Googler
authored andcommitted
Project import generated by Copybara.
GitOrigin-RevId: f55ee064c3da587fe3919afb266f5612536e24a1
0 parents  commit accfe1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6397
-0
lines changed

.gitignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Build artifacts
2+
*.py[cod]
3+
__pycache__
4+
*.egg-info/
5+
build/
6+
dist/
7+
8+
# Documentation-related
9+
docs/_build
10+
11+
# Test files
12+
.nox/
13+
.tox/
14+
.cache/
15+
.pytest_cache/
16+
cert_path
17+
key_path
18+
19+
# Coverage files
20+
.coverage
21+
coverage.xml
22+
*sponge_log.xml
23+
nosetests.xml
24+
htmlcov/
25+
26+
# PyCharm configuration:
27+
.idea
28+
venv/
29+
30+
# Generated files
31+
pylintrc
32+
pylintrc.test
33+
pytype_output/
34+
35+
.DS_Store
36+
37+
# Composer CLI
38+
composer/

.kokoro/tests/requirements.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nox==2022.1.7
2+
importlib-metadata<5,>=0.23
3+
typing-extensions>=3.7.4

.kokoro/tests/requirements.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.10
3+
# To update, run:
4+
#
5+
# pip-compile --generate-hashes requirements.in
6+
#
7+
argcomplete==1.12.3 \
8+
--hash=sha256:291f0beca7fd49ce285d2f10e4c1c77e9460cf823eef2de54df0c0fec88b0d81 \
9+
--hash=sha256:2c7dbffd8c045ea534921e63b0be6fe65e88599990d8dc408ac8c542b72a5445
10+
# via nox
11+
colorlog==6.7.0 \
12+
--hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \
13+
--hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5
14+
# via nox
15+
distlib==0.3.6 \
16+
--hash=sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46 \
17+
--hash=sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e
18+
# via virtualenv
19+
filelock==3.8.0 \
20+
--hash=sha256:55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc \
21+
--hash=sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4
22+
# via virtualenv
23+
importlib-metadata==4.13.0 \
24+
--hash=sha256:8a8a81bcf996e74fee46f0d16bd3eaa382a7eb20fd82445c3ad11f4090334116 \
25+
--hash=sha256:dd0173e8f150d6815e098fd354f6414b0f079af4644ddfe90c71e2fc6174346d
26+
# via -r requirements.in
27+
nox==2022.1.7 \
28+
--hash=sha256:96cca88779e08282a699d672258ec01eb7c792d35bbbf538c723172bce23212c \
29+
--hash=sha256:efee12f02d39405b16d68f60e7a06fe1fc450ae58669d6cdda8c7f48e3bae9e3
30+
# via -r requirements.in
31+
packaging==21.3 \
32+
--hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \
33+
--hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522
34+
# via nox
35+
platformdirs==2.5.2 \
36+
--hash=sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788 \
37+
--hash=sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19
38+
# via virtualenv
39+
py==1.11.0 \
40+
--hash=sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719 \
41+
--hash=sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378
42+
# via nox
43+
pyparsing==3.0.9 \
44+
--hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \
45+
--hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc
46+
# via packaging
47+
typing-extensions==4.4.0 \
48+
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
49+
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e
50+
# via -r requirements.in
51+
virtualenv==20.16.5 \
52+
--hash=sha256:227ea1b9994fdc5ea31977ba3383ef296d7472ea85be9d6732e42a91c04e80da \
53+
--hash=sha256:d07dfc5df5e4e0dbc92862350ad87a36ed505b978f6c39609dc489eadd5b0d27
54+
# via nox
55+
zipp==3.10.0 \
56+
--hash=sha256:4fcb6f278987a6605757302a6e40e896257570d11c51628968ccb2a47e80c6c1 \
57+
--hash=sha256:7a7262fd930bd3e36c50b9a64897aec3fafff3dfdeec9623ae22b40e93f99bb8
58+
# via importlib-metadata

.kokoro/tests/run_tests.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set -e
16+
17+
# add user's pip binary path to PATH
18+
export PATH="${HOME}/.local/bin:${PATH}"
19+
20+
if [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSX
21+
# Mac requires .13 fix versions (which is not available for other platforms)
22+
pyenv install --skip-existing 3.7.13
23+
pyenv global 3.7.13
24+
else
25+
pyenv install --skip-existing 3.7.10
26+
pyenv global 3.7.10
27+
fi
28+
29+
# install nox for testing
30+
python -m pip install --require-hashes --upgrade --quiet -r .kokoro/tests/requirements.txt
31+
python -m nox --version
32+
33+
echo -e "******************** Running tests... ********************\n"
34+
python -m nox -s "unit"
35+
echo -e "******************** Tests complete. ********************\n"

.kokoro/unit/kokoro_build.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Copyright 2022 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Fail on any error.
18+
19+
# Display commands being run.
20+
# WARNING: please only enable 'set -x' if necessary for debugging, and be very
21+
# careful if you handle credentials (e.g. from Keystore) with 'set -x':
22+
# statements like "export VAR=$(cat /tmp/keystore/credentials)" will result in
23+
# the credentials being printed in build logs.
24+
# Additionally, recursive invocation with credentials as command-line
25+
# parameters, will print the full command, with credentials, in the build logs.
26+
# set -x
27+
28+
cd "${KOKORO_ARTIFACTS_DIR}/git/composer-local-development"
29+
.kokoro/tests/run_tests.sh

.kokoro/unit/presubmit.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- protobuffer -*-
2+
# proto-file: google3/devtools/kokoro/config/proto/build.proto
3+
# proto-message: BuildConfig
4+
5+
# Location of the bash script. Should have value <github_scm.name>/<path_from_repository_root>.
6+
# github_scm.name is specified in the job configuration (next section).
7+
build_file: "composer-local-development/.kokoro/unit/kokoro_build.sh"

.pre-commit-config.yaml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
default_stages: [commit, push]
17+
default_language_version:
18+
# force all unspecified python hooks to run python3
19+
python: python3
20+
minimum_pre_commit_version: "1.20.0"
21+
repos:
22+
- repo: https://github.com/psf/black
23+
rev: 22.3.0
24+
hooks:
25+
- id: black
26+
args: [--config=pyproject.toml]
27+
- repo: https://github.com/asottile/blacken-docs
28+
rev: v1.12.1
29+
hooks:
30+
- id: blacken-docs
31+
alias: black
32+
additional_dependencies: [black==22.3.0]
33+
- repo: https://github.com/PyCQA/isort
34+
rev: 5.10.1
35+
hooks:
36+
- id: isort
37+
name: Run isort to sort imports in Python files
38+
files: \.py$|\.pyi$
39+
exclude: ^build/.*$|^\.tox/.*$|^venv/.*$
40+
- repo: https://github.com/pycqa/pydocstyle
41+
rev: 6.1.1
42+
hooks:
43+
- id: pydocstyle
44+
name: Run pydocstyle to check compliance with Python docstring conventions
45+
args:
46+
- --convention=pep257
47+
- --add-ignore=D100,D102,D103,D104,D105,D107,D202,D205,D400,D401
48+
exclude: |
49+
(?x)
50+
^tests/.*\.py$|
51+
additional_dependencies: ['toml']
52+
- repo: https://github.com/codespell-project/codespell
53+
rev: v2.1.0
54+
hooks:
55+
- id: codespell
56+
name: Run codespell to check for common misspellings in files
57+
entry: bash -c 'echo "If you think that this failure is an error, consider adding the word(s)
58+
to the codespell dictionary at docs/spelling_wordlist.txt.
59+
The word(s) should be in lowercase." && exec codespell "$@"' --
60+
language: python
61+
types: [text]
62+
- repo: local
63+
hooks:
64+
- id: markdownlint
65+
name: Run markdownlint to check the style of Markdown files
66+
description: Checks the style of Markdown files.
67+
entry: markdownlint
68+
language: node
69+
types: [markdown]
70+
files: \.(md|mdown|markdown)$
71+
additional_dependencies: ['markdownlint-cli']
72+
- repo: https://github.com/Lucas-C/pre-commit-hooks
73+
rev: v1.1.10
74+
hooks:
75+
- id: insert-license
76+
name: Add license for all Python and shell files
77+
exclude: ^\.github/.*$
78+
files: \.py$|\.pyi|\.bash$|\.sh$
79+
args:
80+
- --comment-style
81+
- "|#|"
82+
- --license-filepath
83+
- scripts/LICENSE.txt
84+
- --fuzzy-match-generates-todo
85+
- id: insert-license
86+
name: Add license for all rst files
87+
exclude: ^\.github/.*$
88+
args:
89+
- --comment-style
90+
- "||"
91+
- --license-filepath
92+
- scripts/LICENSE.rst
93+
- --fuzzy-match-generates-todo
94+
files: \.rst$
95+
- id: insert-license
96+
name: Add license for all YAML files
97+
exclude: ^\.github/.*$
98+
types: [yaml]
99+
files: \.yml$|\.yaml$
100+
args:
101+
- --comment-style
102+
- "|#|"
103+
- --license-filepath
104+
- scripts/LICENSE.txt
105+
- --fuzzy-match-generates-todo

CONTRIBUTING.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project. There are
4+
just a few small guidelines you need to follow.
5+
6+
## Contributor License Agreement
7+
8+
Contributions to this project must be accompanied by a Contributor License
9+
Agreement (CLA). You (or your employer) retain the copyright to your
10+
contribution; this simply gives us permission to use and redistribute your
11+
contributions as part of the project. Head over to
12+
<https://cla.developers.google.com/> to see your current agreements on file or
13+
to sign a new one.
14+
15+
You generally only need to submit a CLA once, so if you've already submitted one
16+
(even if it was for a different project), you probably don't need to do it
17+
again.
18+
19+
## Code Reviews
20+
21+
All submissions, including submissions by project members, require review. We
22+
use GitHub pull requests for this purpose. Consult
23+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
24+
information on using pull requests.
25+
26+
## Community Guidelines
27+
28+
This project follows
29+
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).

CONTRIBUTING.rst

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.. Copyright 2022 Google LLC
2+
3+
.. Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
.. http://www.apache.org/licenses/LICENSE-2.0
8+
9+
.. Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
15+
Contributing
16+
===============
17+
18+
Configure pre-commits
19+
----------------------
20+
Install Composer with the 'dev' profile to include pre-commit dependency::
21+
22+
pip install .[dev]
23+
24+
Install hooks by running in the project root::
25+
26+
pre-commit install
27+
28+
Pre-commit hooks will run on every commit on modified files. If you want to
29+
run them manually run::
30+
31+
pre-commit run --all-files
32+
33+
If you need to commit changes without running precommit add ``--no-verify`` flag::
34+
35+
git commit --no-verify
36+
37+
Nox
38+
----
39+
For running our tests, calculating test coverage and building documentation we
40+
are using ``nox``. It is included in ``tests` setup profile. To install it run::
41+
42+
pip install composer-dev[tests]
43+
44+
To install it from the source code, run in the project root::
45+
46+
pip install -e .[tests]
47+
48+
Documentation
49+
-----------------
50+
We're using ``sphinx`` for our documentation. You can access and modify documentation
51+
source files in ``docs/source`` directory. To build the documentation run::
52+
53+
nox -s docs

0 commit comments

Comments
 (0)