From 1daaaba70fea5f80b75b24451334b745031e7056 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 24 Dec 2023 11:30:50 +0000 Subject: [PATCH 1/2] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 8 ++++---- .github/workflows/release.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e82e08..1ed15f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install project @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install project @@ -63,7 +63,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install project @@ -81,7 +81,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Pip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c42c994..6eb011f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies From c27b0ff997865c2e5c6de9a7de49e0129006cbb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sun, 24 Dec 2023 11:31:01 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=85=20Ready=20to=20clone=20and=20code?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/rename_project.sh | 10 +++++----- .github/template.yml | 1 - ABOUT_THIS_TEMPLATE.md | 4 ++-- CONTRIBUTING.md | 8 ++++---- Containerfile | 2 +- MANIFEST.in | 2 +- Makefile | 20 ++++++++++---------- README.md | 20 ++++++++++---------- {project_name => gmaps_scrapper}/VERSION | 0 {project_name => gmaps_scrapper}/__init__.py | 0 gmaps_scrapper/__main__.py | 6 ++++++ {project_name => gmaps_scrapper}/base.py | 6 +++--- {project_name => gmaps_scrapper}/cli.py | 4 ++-- mkdocs.yml | 2 +- project_name/__main__.py | 6 ------ setup.py | 16 ++++++++-------- tests/test_base.py | 4 ++-- 17 files changed, 55 insertions(+), 56 deletions(-) delete mode 100644 .github/template.yml rename {project_name => gmaps_scrapper}/VERSION (100%) rename {project_name => gmaps_scrapper}/__init__.py (100%) create mode 100644 gmaps_scrapper/__main__.py rename {project_name => gmaps_scrapper}/base.py (67%) rename {project_name => gmaps_scrapper}/cli.py (86%) delete mode 100644 project_name/__main__.py diff --git a/.github/rename_project.sh b/.github/rename_project.sh index 8f05495..b08137d 100755 --- a/.github/rename_project.sh +++ b/.github/rename_project.sh @@ -16,10 +16,10 @@ echo "Description: $description"; echo "Renaming project..." -original_author="author_name" -original_name="project_name" -original_urlname="project_urlname" -original_description="project_description" +original_author="asrulsibaoel" +original_name="gmaps_scrapper" +original_urlname="gmaps_scrapper" +original_description="Awesome gmaps_scrapper created by asrulsibaoel" # for filename in $(find . -name "*.*") for filename in $(git ls-files) do @@ -30,7 +30,7 @@ do echo "Renamed $filename" done -mv project_name $name +mv gmaps_scrapper $name # This command runs only once on GHA! rm -rf .github/template.yml diff --git a/.github/template.yml b/.github/template.yml deleted file mode 100644 index 3386bee..0000000 --- a/.github/template.yml +++ /dev/null @@ -1 +0,0 @@ -author: rochacbruno diff --git a/ABOUT_THIS_TEMPLATE.md b/ABOUT_THIS_TEMPLATE.md index 11795f3..5310171 100644 --- a/ABOUT_THIS_TEMPLATE.md +++ b/ABOUT_THIS_TEMPLATE.md @@ -32,7 +32,7 @@ Lets take a look at the structure of this template: ├── Makefile # A collection of utilities to manage the project ├── MANIFEST.in # A list of files to include in a package ├── mkdocs.yml # Configuration for documentation site -├── project_name # The main python package for the project +├── gmaps_scrapper # The main python package for the project │   ├── base.py # The base module for the project │   ├── __init__.py # This tells Python that this is a package │   ├── __main__.py # The entry point for the project @@ -109,7 +109,7 @@ I had to do some tricks to read that version variable inside the setuptools I decided to keep the version in a static file because it is easier to read from wherever I want without the need to install the package. -e.g: `cat project_name/VERSION` will get the project version without harming +e.g: `cat gmaps_scrapper/VERSION` will get the project version without harming with module imports or anything else, it is useful for CI, logs and debugging. ### Why to include `tests`, `history` and `Containerfile` as part of the release? diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d0dd72..ba8ebab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # How to develop on this project -project_name welcomes contributions from the community. +gmaps_scrapper welcomes contributions from the community. **You need PYTHON3!** @@ -8,9 +8,9 @@ This instructions are for linux base systems. (Linux, MacOS, BSD, etc.) ## Setting up your own fork of this repo. - On github interface click on `Fork` button. -- Clone your fork of this repo. `git clone git@github.com:YOUR_GIT_USERNAME/project_urlname.git` -- Enter the directory `cd project_urlname` -- Add upstream repo `git remote add upstream https://github.com/author_name/project_urlname` +- Clone your fork of this repo. `git clone git@github.com:YOUR_GIT_USERNAME/gmaps_scrapper.git` +- Enter the directory `cd gmaps_scrapper` +- Add upstream repo `git remote add upstream https://github.com/asrulsibaoel/gmaps_scrapper` ## Setting up your own virtual environment diff --git a/Containerfile b/Containerfile index 83bb605..94e0e72 100644 --- a/Containerfile +++ b/Containerfile @@ -2,4 +2,4 @@ FROM python:3.7-slim COPY . /app WORKDIR /app RUN pip install . -CMD ["project_name"] +CMD ["gmaps_scrapper"] diff --git a/MANIFEST.in b/MANIFEST.in index ef198d6..22f0e7b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,4 @@ include LICENSE include HISTORY.md include Containerfile graft tests -graft project_name +graft gmaps_scrapper diff --git a/Makefile b/Makefile index 52d91ac..4f65d6a 100644 --- a/Makefile +++ b/Makefile @@ -26,20 +26,20 @@ install: ## Install the project in dev mode. .PHONY: fmt fmt: ## Format code using black & isort. - $(ENV_PREFIX)isort project_name/ - $(ENV_PREFIX)black -l 79 project_name/ + $(ENV_PREFIX)isort gmaps_scrapper/ + $(ENV_PREFIX)black -l 79 gmaps_scrapper/ $(ENV_PREFIX)black -l 79 tests/ .PHONY: lint lint: ## Run pep8, black, mypy linters. - $(ENV_PREFIX)flake8 project_name/ - $(ENV_PREFIX)black -l 79 --check project_name/ + $(ENV_PREFIX)flake8 gmaps_scrapper/ + $(ENV_PREFIX)black -l 79 --check gmaps_scrapper/ $(ENV_PREFIX)black -l 79 --check tests/ - $(ENV_PREFIX)mypy --ignore-missing-imports project_name/ + $(ENV_PREFIX)mypy --ignore-missing-imports gmaps_scrapper/ .PHONY: test test: lint ## Run tests and generate coverage report. - $(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=project_name -l --tb=short --maxfail=1 tests/ + $(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=gmaps_scrapper -l --tb=short --maxfail=1 tests/ $(ENV_PREFIX)coverage xml $(ENV_PREFIX)coverage html @@ -78,9 +78,9 @@ virtualenv: ## Create a virtual environment. release: ## Create a new tag for release. @echo "WARNING: This operation will create s version tag and push to github" @read -p "Version? (provide the next x.y.z semver) : " TAG - @echo "$${TAG}" > project_name/VERSION + @echo "$${TAG}" > gmaps_scrapper/VERSION @$(ENV_PREFIX)gitchangelog > HISTORY.md - @git add project_name/VERSION HISTORY.md + @git add gmaps_scrapper/VERSION HISTORY.md @git commit -m "release: version $${TAG} 🚀" @echo "creating git tag : $${TAG}" @git tag $${TAG} @@ -101,7 +101,7 @@ switch-to-poetry: ## Switch to poetry package manager. @poetry init --no-interaction --name=a_flask_test --author=rochacbruno @echo "" >> pyproject.toml @echo "[tool.poetry.scripts]" >> pyproject.toml - @echo "project_name = 'project_name.__main__:main'" >> pyproject.toml + @echo "gmaps_scrapper = 'gmaps_scrapper.__main__:main'" >> pyproject.toml @cat requirements.txt | while read in; do poetry add --no-interaction "$${in}"; done @cat requirements-test.txt | while read in; do poetry add --no-interaction "$${in}" --dev; done @poetry install --no-interaction @@ -109,7 +109,7 @@ switch-to-poetry: ## Switch to poetry package manager. @mv requirements* .github/backup @mv setup.py .github/backup @echo "You have switched to https://python-poetry.org/ package manager." - @echo "Please run 'poetry shell' or 'poetry run project_name'" + @echo "Please run 'poetry shell' or 'poetry run gmaps_scrapper'" .PHONY: init init: ## Initialize the project based on an application template. diff --git a/README.md b/README.md index 21f444c..775f6f6 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ See also - ✅ Code linting using [flake8](https://flake8.pycqa.org/en/latest/) - 📊 Code coverage reports using [codecov](https://about.codecov.io/sign-up/) - 🛳️ Automatic release to [PyPI](https://pypi.org) using [twine](https://twine.readthedocs.io/en/latest/) and github actions. -- 🎯 Entry points to execute your program using `python -m ` or `$ project_name` with basic CLI argument parsing. +- 🎯 Entry points to execute your program using `python -m ` or `$ gmaps_scrapper` with basic CLI argument parsing. - 🔄 Continuous integration using [Github Actions](.github/workflows/) with jobs to lint, test and release your project on Linux, Mac and Windows environments. > Curious about architectural decisions on this template? read [ABOUT_THIS_TEMPLATE.md](ABOUT_THIS_TEMPLATE.md) @@ -51,33 +51,33 @@ See also --- -# project_name +# gmaps_scrapper -[![codecov](https://codecov.io/gh/author_name/project_urlname/branch/main/graph/badge.svg?token=project_urlname_token_here)](https://codecov.io/gh/author_name/project_urlname) -[![CI](https://github.com/author_name/project_urlname/actions/workflows/main.yml/badge.svg)](https://github.com/author_name/project_urlname/actions/workflows/main.yml) +[![codecov](https://codecov.io/gh/asrulsibaoel/gmaps_scrapper/branch/main/graph/badge.svg?token=gmaps_scrapper_token_here)](https://codecov.io/gh/asrulsibaoel/gmaps_scrapper) +[![CI](https://github.com/asrulsibaoel/gmaps_scrapper/actions/workflows/main.yml/badge.svg)](https://github.com/asrulsibaoel/gmaps_scrapper/actions/workflows/main.yml) -project_description +Awesome gmaps_scrapper created by asrulsibaoel ## Install it from PyPI ```bash -pip install project_name +pip install gmaps_scrapper ``` ## Usage ```py -from project_name import BaseClass -from project_name import base_function +from gmaps_scrapper import BaseClass +from gmaps_scrapper import base_function BaseClass().base_method() base_function() ``` ```bash -$ python -m project_name +$ python -m gmaps_scrapper #or -$ project_name +$ gmaps_scrapper ``` ## Development diff --git a/project_name/VERSION b/gmaps_scrapper/VERSION similarity index 100% rename from project_name/VERSION rename to gmaps_scrapper/VERSION diff --git a/project_name/__init__.py b/gmaps_scrapper/__init__.py similarity index 100% rename from project_name/__init__.py rename to gmaps_scrapper/__init__.py diff --git a/gmaps_scrapper/__main__.py b/gmaps_scrapper/__main__.py new file mode 100644 index 0000000..afdbcb9 --- /dev/null +++ b/gmaps_scrapper/__main__.py @@ -0,0 +1,6 @@ +"""Entry point for gmaps_scrapper.""" + +from gmaps_scrapper.cli import main # pragma: no cover + +if __name__ == "__main__": # pragma: no cover + main() diff --git a/project_name/base.py b/gmaps_scrapper/base.py similarity index 67% rename from project_name/base.py rename to gmaps_scrapper/base.py index ac590b9..8d869ef 100644 --- a/project_name/base.py +++ b/gmaps_scrapper/base.py @@ -1,7 +1,7 @@ """ -project_name base module. +gmaps_scrapper base module. -This is the principal module of the project_name project. +This is the principal module of the gmaps_scrapper project. here you put your main classes and objects. Be creative! do whatever you want! @@ -14,4 +14,4 @@ """ # example constant variable -NAME = "project_name" +NAME = "gmaps_scrapper" diff --git a/project_name/cli.py b/gmaps_scrapper/cli.py similarity index 86% rename from project_name/cli.py rename to gmaps_scrapper/cli.py index 66e9ca1..173cf96 100644 --- a/project_name/cli.py +++ b/gmaps_scrapper/cli.py @@ -1,4 +1,4 @@ -"""CLI interface for project_name project. +"""CLI interface for gmaps_scrapper project. Be creative! do whatever you want! @@ -12,7 +12,7 @@ def main(): # pragma: no cover """ The main function executes on commands: - `python -m project_name` and `$ project_name `. + `python -m gmaps_scrapper` and `$ gmaps_scrapper `. This is your program's entry point. diff --git a/mkdocs.yml b/mkdocs.yml index 33a69ca..4447ac1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,2 +1,2 @@ -site_name: project_name +site_name: gmaps_scrapper theme: readthedocs diff --git a/project_name/__main__.py b/project_name/__main__.py deleted file mode 100644 index 2ba8b18..0000000 --- a/project_name/__main__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Entry point for project_name.""" - -from project_name.cli import main # pragma: no cover - -if __name__ == "__main__": # pragma: no cover - main() diff --git a/setup.py b/setup.py index 7547627..a4835e3 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -"""Python setup.py for project_name package""" +"""Python setup.py for gmaps_scrapper package""" import io import os from setuptools import find_packages, setup @@ -6,7 +6,7 @@ def read(*paths, **kwargs): """Read the contents of a text file safely. - >>> read("project_name", "VERSION") + >>> read("gmaps_scrapper", "VERSION") '0.1.0' >>> read("README.md") ... @@ -30,17 +30,17 @@ def read_requirements(path): setup( - name="project_name", - version=read("project_name", "VERSION"), - description="project_description", - url="https://github.com/author_name/project_urlname/", + name="gmaps_scrapper", + version=read("gmaps_scrapper", "VERSION"), + description="Awesome gmaps_scrapper created by asrulsibaoel", + url="https://github.com/asrulsibaoel/gmaps_scrapper/", long_description=read("README.md"), long_description_content_type="text/markdown", - author="author_name", + author="asrulsibaoel", packages=find_packages(exclude=["tests", ".github"]), install_requires=read_requirements("requirements.txt"), entry_points={ - "console_scripts": ["project_name = project_name.__main__:main"] + "console_scripts": ["gmaps_scrapper = gmaps_scrapper.__main__:main"] }, extras_require={"test": read_requirements("requirements-test.txt")}, ) diff --git a/tests/test_base.py b/tests/test_base.py index f1b765f..477bc57 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,5 +1,5 @@ -from project_name.base import NAME +from gmaps_scrapper.base import NAME def test_base(): - assert NAME == "project_name" + assert NAME == "gmaps_scrapper"