diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f0a6bf4..da9aef1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -13,7 +13,7 @@ Provide a clear and concise description of the bug. Include source code: ```python -from weatherapi.app import app +from google_sheets.app import app ... ``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index d2284c6..7b726a4 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,4 +5,4 @@ contact_links: about: Please report security vulnerabilities to info@airt.ai - name: Question or Problem about: Ask a question or ask about a problem in GitHub Discussions. - url: https://github.com/airtai/weatherapi/discussions/categories/questions + url: https://github.com/airtai/google-sheets/discussions/categories/questions diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 4be39ef..09b3c8f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -15,10 +15,10 @@ Provide a clear and concise description of the problem you've encountered. For e Clearly and concisely describe the desired outcome or solution. **Feature code example** -To help others understand the proposed feature, illustrate it with a **weatherapi** code example: +To help others understand the proposed feature, illustrate it with a **google-sheets** code example: ```python -from weatherapi.app import app +from google_sheets.app import app ... ``` diff --git a/.github/workflows/docker_cleanup.yml b/.github/workflows/docker_cleanup.yml index 29224b5..68822c3 100644 --- a/.github/workflows/docker_cleanup.yml +++ b/.github/workflows/docker_cleanup.yml @@ -16,7 +16,7 @@ jobs: with: # NOTE: at now only orgs is supported owner: airtai - name: weatherapi + name: google-sheets token: ${{ secrets.GITHUB_TOKEN }} # Keep latest N untagged images diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3d8f8d1..c15db06 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,11 +29,11 @@ jobs: pip install -e ".[docs,lint]" - name: Run mypy shell: bash - run: mypy weatherapi tests + run: mypy google_sheets tests - name: Run bandit shell: bash - run: bandit -c pyproject.toml -r weatherapi + run: bandit -c pyproject.toml -r google_sheets - name: Run Semgrep shell: bash @@ -146,7 +146,7 @@ jobs: - run: ls -la coverage - run: coverage combine coverage - run: coverage report - - run: coverage html --show-contexts --title "weatherapi coverage for ${{ github.sha }}" + - run: coverage html --show-contexts --title "google-sheets coverage for ${{ github.sha }}" - name: Store coverage html uses: actions/upload-artifact@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ca242ec..1c1303e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,13 +36,13 @@ After activating the virtual environment as described above, run: pip install -e ".[dev]" ``` -This will install all the dependencies and your local **WeatherAPI** in your virtual environment. +This will install all the dependencies and your local **GoogleSheetsAPI** in your virtual environment. -### Using Your local **WeatherAPI** +### Using Your local **GoogleSheetsAPI** -If you create a Python file that imports and uses **WeatherAPI**, and run it with the Python from your local environment, it will use your local **WeatherAPI** source code. +If you create a Python file that imports and uses **GoogleSheetsAPI**, and run it with the Python from your local environment, it will use your local **GoogleSheetsAPI** source code. -Whenever you update your local **WeatherAPI** source code, it will automatically use the latest version when you run your Python file again. This is because it is installed with `-e`. +Whenever you update your local **GoogleSheetsAPI** source code, it will automatically use the latest version when you run your Python file again. This is because it is installed with `-e`. This way, you don't have to "install" your local version to be able to test every change. @@ -50,7 +50,7 @@ This way, you don't have to "install" your local version to be able to test ever ### Pytest -To run tests with your current **WeatherAPI** application and Python environment, use: +To run tests with your current **GoogleSheetsAPI** application and Python environment, use: ```bash pytest tests diff --git a/Dockerfile b/Dockerfile index 84fc967..81db697 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 RUN python3 -m pip install --upgrade pip -COPY weatherapi ./weatherapi +COPY google_sheets ./google_sheets COPY scripts/* pyproject.toml README.md ./ RUN pip install -e ".[dev]" diff --git a/README.md b/README.md index e2af006..dc639e4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# Weather API -A simple weather API made for usage with FastAgency +# Google Sheets API +A simple Google Sheets API made for usage with FastAgency diff --git a/SECURITY.md b/SECURITY.md index 11cfd95..dbabd5e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,14 +1,14 @@ # Security Policy -Security and stability are paramount for WeatherAPI. +Security and stability are paramount for google-sheets. Learn more below. 👇 ## Versions -The latest version of WeatherAPI is actively supported. +The latest version of google-sheets is actively supported. -We strongly encourage you to write tests for your application and regularly update your WeatherAPI version after confirming that your tests pass. This ensures you benefit from the latest features, bug fixes, and **security updates**. +We strongly encourage you to write tests for your application and regularly update your google-sheets version after confirming that your tests pass. This ensures you benefit from the latest features, bug fixes, and **security updates**. ## Reporting a Vulnerability diff --git a/docker-compose.yaml b/docker-compose.yaml index 5ba32a4..2d5f2cd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,7 +11,7 @@ x-logging: &default-logging version: "3.4" -name: weatherapi +name: google-sheets services: fastapi-app: # nosemgrep image: ghcr.io/${GITHUB_REPOSITORY}:${TAG} @@ -22,8 +22,8 @@ services: - DOMAIN=${DOMAIN} logging: *default-logging networks: - - weatherapi + - google-sheets networks: - weatherapi: - name: weatherapi + google-sheets: + name: google-sheets diff --git a/google_sheets/__about__.py b/google_sheets/__about__.py new file mode 100644 index 0000000..787b2d1 --- /dev/null +++ b/google_sheets/__about__.py @@ -0,0 +1,3 @@ +"""A simple Google Sheets API made for usage with FastAgency.""" + +__version__ = "0.1.0" diff --git a/google_sheets/__init__.py b/google_sheets/__init__.py new file mode 100644 index 0000000..1f72f24 --- /dev/null +++ b/google_sheets/__init__.py @@ -0,0 +1,5 @@ +"""A simple Google Sheets API made for usage with FastAgency.""" + +from .__about__ import __version__ + +__all__ = ["__version__"] diff --git a/weatherapi/app.py b/google_sheets/app.py similarity index 98% rename from weatherapi/app.py rename to google_sheets/app.py index 7ed9c8d..0482918 100644 --- a/weatherapi/app.py +++ b/google_sheets/app.py @@ -23,7 +23,7 @@ app = FastAPI( servers=[{"url": base_url, "description": "Weather app server"}], version=__version__, - title="WeatherAPI", + title="google-sheets", ) diff --git a/pyproject.toml b/pyproject.toml index 6b9411c..f9fa5e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,8 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "weatherapi" -description = "WeatherAPI: A simple weather API made for usage with FastAgency" +name = "google-sheets" +description = "google-sheets: A simple Google Sheets API made for usage with FastAgency" readme = "README.md" authors = [ { name = "airt", email = "info@airt.ai" }, @@ -78,26 +78,26 @@ test-core = [ ] testing = [ - "weatherapi[test-core]", - "weatherapi[server]", # Uvicorn is needed for testing + "google-sheets[test-core]", + "google-sheets[server]", # Uvicorn is needed for testing ] dev = [ - "weatherapi[server,lint,testing]", + "google-sheets[server,lint,testing]", "pre-commit==3.7.1", "detect-secrets==1.5.0", ] [project.urls] -Tracker = "https://github.com/airtai/weatherapi/issues" -Source = "https://github.com/airtai/weatherapi" +Tracker = "https://github.com/airtai/google-sheets/issues" +Source = "https://github.com/airtai/google-sheets" Discord = "https://discord.gg/qFm6aSqq59" [project.scripts] -# weatherapi = "weatherapi.__main__:cli" +# google_sheets = "google_sheets.__main__:cli" [tool.hatch.version] -path = "weatherapi/__about__.py" +path = "google_sheets/__about__.py" [tool.hatch.build] skip-excluded-dirs = true @@ -110,15 +110,15 @@ exclude = [ allow-direct-references = true [tool.hatch.build.targets.wheel] -only-include = ["weatherapi"] +only-include = ["google_sheets"] [tool.hatch.build.targets.wheel.sources] "src" = "" -# "scripts" = "weatherapi/templates" +# "scripts" = "google_sheets/templates" [tool.mypy] -files = ["weatherapi", "tests"] +files = ["google_sheets", "tests"] strict = true python_version = "3.9" @@ -145,7 +145,7 @@ disallow_any_unimported = false fix = true line-length = 88 # target-version = 'py39' -include = ["weatherapi/**/*.py", "weatherapi/**/*.pyi", "tests/**/*.py", "pyproject.toml"] +include = ["google_sheets/**/*.py", "google_sheets/**/*.pyi", "tests/**/*.py", "pyproject.toml"] exclude = ["docs/docs_src"] [tool.ruff.lint] @@ -206,7 +206,7 @@ concurrency = [ "thread" ] source = [ - "weatherapi", + "google_sheets", # "tests", ] context = '${CONTEXT}' diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 8fd8bc7..cd45fe8 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -22,7 +22,7 @@ fi ssh_command="ssh -o StrictHostKeyChecking=no -i key.pem azureuser@$DOMAIN" -container_name="weatherapi" +container_name="google-sheets" log_file="${container_name}.log" echo "INFO: Capturing docker container logs" diff --git a/scripts/lint-pre-commit.sh b/scripts/lint-pre-commit.sh index e8d2f45..70492b6 100755 --- a/scripts/lint-pre-commit.sh +++ b/scripts/lint-pre-commit.sh @@ -28,5 +28,5 @@ pip install --editable ".[dev]" \ # and specify the package to run on explicitly. # Note that we do not use --ignore-missing-imports, # as this can give us false confidence in our results. -# mypy weatherapi +# mypy google-sheets ./scripts/lint.sh diff --git a/scripts/lint.sh b/scripts/lint.sh index 114d2e1..37ab623 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo "Running pyup_dirs..." -pyup_dirs --py38-plus --recursive weatherapi tests +pyup_dirs --py38-plus --recursive google_sheets tests echo "Running ruff linter (isort, flake, pyupgrade, etc. replacement)..." ruff check @@ -10,4 +10,4 @@ echo "Running ruff formater (black replacement)..." ruff format # echo "Running black..." -# black weatherapi examples tests docs +# black google_sheets examples tests docs diff --git a/scripts/run_server.sh b/scripts/run_server.sh index d0ac6d2..d8e6c98 100755 --- a/scripts/run_server.sh +++ b/scripts/run_server.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -uvicorn weatherapi.app:app --workers 2 --host 0.0.0.0 --proxy-headers +uvicorn google_sheets.app:app --workers 2 --host 0.0.0.0 --proxy-headers diff --git a/scripts/static-analysis.sh b/scripts/static-analysis.sh index 8fd829b..c8e907d 100755 --- a/scripts/static-analysis.sh +++ b/scripts/static-analysis.sh @@ -6,7 +6,7 @@ echo "Running mypy..." mypy echo "Running bandit..." -bandit -c pyproject.toml -r weatherapi +bandit -c pyproject.toml -r google_sheets echo "Running semgrep..." semgrep scan --config auto --error diff --git a/scripts/static-pre-commit.sh b/scripts/static-pre-commit.sh index 06ae1e7..7f2a29b 100755 --- a/scripts/static-pre-commit.sh +++ b/scripts/static-pre-commit.sh @@ -28,5 +28,5 @@ pip install --editable ".[dev]" \ # and specify the package to run on explicitly. # Note that we do not use --ignore-missing-imports, # as this can give us false confidence in our results. -# mypy weatherapi +# mypy google-sheets ./scripts/static-analysis.sh diff --git a/tests/app/test_app.py b/tests/app/test_app.py index b5a8bd8..3a27068 100644 --- a/tests/app/test_app.py +++ b/tests/app/test_app.py @@ -2,8 +2,8 @@ from fastapi.testclient import TestClient -from weatherapi import __version__ as version -from weatherapi.app import app +from google_sheets import __version__ as version +from google_sheets.app import app client = TestClient(app) @@ -37,7 +37,7 @@ def test_weather_route(self) -> None: def test_openapi(self) -> None: expected = { "openapi": "3.1.0", - "info": {"title": "WeatherAPI", "version": version}, + "info": {"title": "google-sheets", "version": version}, "servers": [ {"url": "http://localhost:8000", "description": "Weather app server"} ], diff --git a/weatherapi/__about__.py b/weatherapi/__about__.py deleted file mode 100644 index a9fae82..0000000 --- a/weatherapi/__about__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""A simple weather API made for usage with FastAgency.""" - -__version__ = "0.1.0" diff --git a/weatherapi/__init__.py b/weatherapi/__init__.py deleted file mode 100644 index 43eb614..0000000 --- a/weatherapi/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""A simple weather API made for usage with FastAgency.""" - -from .__about__ import __version__ - -__all__ = ["__version__"]