Skip to content

Commit 13ae82f

Browse files
authored
chore: Update CONTRIBUTING (#154)
1 parent 7dbc4b5 commit 13ae82f

File tree

3 files changed

+51
-25
lines changed

3 files changed

+51
-25
lines changed

CONTRIBUTING.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,57 @@ You generally only need to submit a CLA once, so if you've already submitted one
1515
(even if it was for a different project), you probably don't need to do it
1616
again.
1717

18+
## Community Guidelines
19+
20+
This project follows
21+
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
22+
1823
## Code reviews
1924

2025
All submissions, including submissions by project members, require review. We
2126
use GitHub pull requests for this purpose. Consult
2227
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
2328
information on using pull requests.
2429

25-
## Community Guidelines
30+
## Running tests
2631

27-
This project follows
28-
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
32+
### Initial Setup
33+
34+
1. Enable the SQL Admin API.
35+
2. This library uses [Application Default Credentials (ADC)][adc]] to
36+
automatically detect credentials. Which ever credential you use must have the
37+
Cloud SQL client role (or equivalent permissions).
38+
3. You'll need to create several Cloud SQL instances - one for MySQL, Postgres,
39+
and SQL Server.
40+
2. Once created, set the following environment variables:
41+
```
42+
export MYSQL_CONNECTION_NAME="your:connection:string"
43+
export MYSQL_USER="db_user"
44+
export MYSQL_PASS="db_pass"
45+
export MYSQL_DB="db_name"
46+
47+
export POSTGRES_CONNECTION_NAME="your:connection:string"
48+
export POSTGRES_USER="db_user"
49+
export POSTGRES_PASS="db_pass"
50+
export POSTGRES_DB="db_name"
51+
52+
# This instance will need to have IAM Database authentication enabled
53+
export POSTGRES_IAM_CONNECTION_NAME="your:connection:string"
54+
export POSTGRES_IAM_USER="[email protected]"
55+
56+
export SQLSERVER_CONNECTION_NAME="your:connection:string"
57+
export SQLSERVER_USER="db_user"
58+
export SQLSERVER_PASS="db_pass"
59+
export SQLSERVER_DB="db_name"
60+
```
61+
62+
### Running tests
63+
64+
Tests can be run with `nox`. You can install nox with `pip install nox`, and
65+
run specific tests with `nox -s $SESSION_NAME`.
66+
67+
Note: You may need a specific version of python installed to run those tests.
68+
For example, you'll need Python 3.8 installed to run `unit-3.8` or
69+
`system-3.8`.
70+
71+
[adc]: https://cloud.google.com/docs/authentication/best-practices-applications#overview_of_application_default_credentials

README.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -173,24 +173,7 @@ This project aims for a minimum monthly release cadence. If no new
173173
features or fixes have been added, a new PATCH version with the latest
174174
dependencies is released.
175175

176-
### Setup for development
176+
### Contributing
177177

178-
Tests can be run with `nox`. Change directory into the `cloud-sql-python-connector` and just run `nox` to run the tests.
179-
180-
1. Create a MySQL instance on Google Cloud SQL. Make sure to note your root password when creating the MySQL instance.
181-
2. When the MySQL instance has finished creating, go to the overview page and set the instance’s connection string to the environment variable MYSQL_CONNECTION_NAME using the following command:
182-
```
183-
export MYSQL_CONNECTION_NAME=your:connection:string
184-
```
185-
3. Enable SSL for your Cloud SQL instance by following [these instructions](https://cloud.google.com/sql/docs/mysql/configure-ssl-instance).
186-
4. Create a service account with Cloud SQL Admin and Cloud SQL Client roles, then download the key and save it in a safe location. Set the path to the json file to the environment variable GOOGLE_APPLICATION_CREDENTIALS using the following command:
187-
```
188-
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/auth/./json
189-
```
190-
5. Enable the SQL Admin API.
191-
6. Clone the [repository](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector).
192-
7. Create a virtual environment and change directory into the `cloud-sql-python-connector` folder.
193-
8. Install the package by running the following command:
194-
```
195-
pip install .
196-
```
178+
We welcome outside contributions. Please see our
179+
[Contributing Guide](CONTRIBUTING.md) for details on how best to contribute.

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
if os.path.exists("samples"):
2727
BLACK_PATHS.append("samples")
2828

29-
@nox.session(python="3.7")
29+
@nox.session
3030
def lint(session):
3131
"""Run linters.
3232
Returns a failure if the linters find linting errors or sufficiently
@@ -43,7 +43,7 @@ def lint(session):
4343
session.run("twine", "check", "dist/*")
4444

4545

46-
@nox.session(python="3.6")
46+
@nox.session
4747
def blacken(session):
4848
"""Run black.
4949
Format code to uniform standard.

0 commit comments

Comments
 (0)