Merge pull request #12 from mabdullahadeel/cookiecutter-master

Merging upstream changes `e34096e`-`2022.02.08`
This commit is contained in:
Abdullah Adeel 2022-02-10 00:51:29 +05:00 committed by GitHub
commit 27776cc7a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 97 additions and 39 deletions

View File

@ -7,5 +7,5 @@ labels: question
First, make sure to examine [the docs](https://cookiecutter-django.readthedocs.io/en/latest/). If that doesn't help, we recommend one of these 3 main channels:
- If your issue is related to Django + something else but was generated with cookiecutter-django, the best is to post a question on [StackOverflow](https://stackoverflow.com/questions/tagged/cookiecutter-django) tagged with `cookiecutter-django`, you would get more visibility from other communities as well.
- Join us on [Discord](https://discord.gg/bTfDa6Zz) and ask around.
- Join us on [Discord](https://discord.gg/uFXweDQc5a) and ask around.
- Start [a discussion](https://github.com/cookiecutter/cookiecutter-django/discussions) on our project's GitHub.

View File

@ -1227,5 +1227,15 @@
"name": "Abdullah Adeel",
"github_login": "mabdullahadeel",
"twitter_username": "abdadeel_"
},
{
"name": "Jorge Valdez",
"github_login": "jorgeavaldez",
"twitter_username": ""
},
{
"name": "Ryan Fitch",
"github_login": "ryfi",
"twitter_username": ""
}
]

View File

@ -31,7 +31,7 @@ jobs:
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.12.0
uses: peter-evans/create-pull-request@v3.12.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate

View File

@ -9,7 +9,7 @@ repos:
- id: check-yaml
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.1.0
hooks:
- id: black

View File

@ -3,6 +3,30 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
<!-- GENERATOR_PLACEHOLDER -->
## 2022.02.08
### Fixed
- Fixed some typos in drf-spectacular description and comments ([#3579](https://github.com/cookiecutter/cookiecutter-django/pull/3579))
### Updated
- Update redis to 4.1.3 ([#3577](https://github.com/cookiecutter/cookiecutter-django/pull/3577))
- Update werkzeug to 2.0.3 ([#3576](https://github.com/cookiecutter/cookiecutter-django/pull/3576))
## 2022.02.07
### Changed
- Update black to 22.1.0 ([#3572](https://github.com/cookiecutter/cookiecutter-django/pull/3572))
### Fixed
- Fix docker-compose config on Apple silicon ([#3562](https://github.com/cookiecutter/cookiecutter-django/pull/3562))
### Updated
- Update uvicorn to 0.17.4 ([#3574](https://github.com/cookiecutter/cookiecutter-django/pull/3574))
- Update django-allauth to 0.48.0 ([#3573](https://github.com/cookiecutter/cookiecutter-django/pull/3573))
- Update pytest to 7.0.0 ([#3567](https://github.com/cookiecutter/cookiecutter-django/pull/3567))
- Update coverage to 6.3.1 ([#3561](https://github.com/cookiecutter/cookiecutter-django/pull/3561))
- Update pillow to 9.0.1 ([#3571](https://github.com/cookiecutter/cookiecutter-django/pull/3571))
- Bump peter-evans/create-pull-request from 3.12.0 to 3.12.1 ([#3558](https://github.com/cookiecutter/cookiecutter-django/pull/3558))
- Update drf-spectacular to 0.21.2 ([#3560](https://github.com/cookiecutter/cookiecutter-django/pull/3560))
- Update django to 3.2.12 ([#3559](https://github.com/cookiecutter/cookiecutter-django/pull/3559))
## 2022.01.27
### Updated

View File

@ -971,6 +971,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Jorge Valdez</td>
<td>
<a href="https://github.com/jorgeavaldez">jorgeavaldez</a>
</td>
<td></td>
</tr>
<tr>
<td>Jules Cheron</td>
<td>
@ -1461,6 +1468,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Ryan Fitch</td>
<td>
<a href="https://github.com/ryfi">ryfi</a>
</td>
<td></td>
</tr>
<tr>
<td>Sam Collins</td>
<td>

View File

@ -3,7 +3,7 @@
[![Build Status](https://img.shields.io/github/workflow/status/cookiecutter/cookiecutter-django/CI/master)](https://github.com/cookiecutter/cookiecutter-django/actions?query=workflow%3ACI)
[![Documentation Status](https://readthedocs.org/projects/cookiecutter-django/badge/?version=latest)](https://cookiecutter-django.readthedocs.io/en/latest/?badge=latest)
[![Updates](https://pyup.io/repos/github/cookiecutter/cookiecutter-django/shield.svg)](https://pyup.io/repos/github/cookiecutter/cookiecutter-django/)
[![Join our Discord](https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white)](https://discord.gg/9BrxzPKuEW)
[![Join our Discord](https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white)](https://discord.gg/uFXweDQc5a)
[![Code Helpers Badge](https://www.codetriage.com/cookiecutter/cookiecutter-django/badges/users.svg)](https://www.codetriage.com/cookiecutter/cookiecutter-django)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
@ -190,8 +190,8 @@ For local development, see the following:
## Community
- Have questions? **Before you ask questions anywhere else**, please post your question on [Stack Overflow](http://stackoverflow.com/questions/tagged/cookiecutter-django) under the _cookiecutter-django_ tag. We check there periodically for questions.
- If you think you found a bug or want to request a feature, please open an [issue](https://github.com/cookiecutter/cookiecutter-django/issues).
- For anything else, you can chat with us on [Discord](https://discord.gg/9BrxzPKuEW).
- If you think you found a bug or want to request a feature, please open an [issue](https://github.com/mabdullahadeel/cookiecutter-django-mysql/issues).
- For anything else, you can chat with us on [Discord](https://discord.gg/uFXweDQc5a).
## For Readers of Two Scoops of Django

View File

@ -1,4 +1,3 @@
[pytest]
addopts = -v --tb=short
python_paths = .
norecursedirs = .tox .git */migrations/* */static/* docs venv */{{cookiecutter.project_slug}}/*

View File

@ -4,7 +4,7 @@ binaryornot==0.4.4
# Code quality
# ------------------------------------------------------------------------------
black==21.12b0
black==22.1.0
isort==5.10.1
flake8==4.0.1
flake8-isort==4.1.1
@ -13,7 +13,7 @@ pre-commit==2.17.0
# Testing
# ------------------------------------------------------------------------------
tox==3.24.5
pytest==6.2.5
pytest==7.0.0
pytest-cookies==0.6.1
pytest-instafail==0.4.2
pyyaml==6.0

View File

@ -5,7 +5,7 @@ except ImportError:
from distutils.core import setup
# We use calendar versioning
version = "2022.01.27"
version = "2022.02.08"
with open("README.rst") as readme_file:
long_description = readme_file.read()

View File

@ -164,10 +164,10 @@ def test_project_generation(cookies, context, context_override):
result = cookies.bake(extra_context={**context, **context_override})
assert result.exit_code == 0
assert result.exception is None
assert result.project.basename == context["project_slug"]
assert result.project.isdir()
assert result.project_path.name == context["project_slug"]
assert result.project_path.is_dir()
paths = build_files_list(str(result.project))
paths = build_files_list(str(result.project_path))
assert paths
check_paths(paths)
@ -178,7 +178,7 @@ def test_flake8_passes(cookies, context_override):
result = cookies.bake(extra_context=context_override)
try:
sh.flake8(_cwd=str(result.project))
sh.flake8(_cwd=str(result.project_path))
except sh.ErrorReturnCode as e:
pytest.fail(e.stdout.decode())
@ -190,7 +190,12 @@ def test_black_passes(cookies, context_override):
try:
sh.black(
"--check", "--diff", "--exclude", "migrations", _cwd=str(result.project)
"--check",
"--diff",
"--exclude",
"migrations",
".",
_cwd=str(result.project_path),
)
except sh.ErrorReturnCode as e:
pytest.fail(e.stdout.decode())
@ -209,10 +214,10 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip
assert result.exit_code == 0
assert result.exception is None
assert result.project.basename == context["project_slug"]
assert result.project.isdir()
assert result.project_path.name == context["project_slug"]
assert result.project_path.is_dir()
with open(f"{result.project}/.travis.yml", "r") as travis_yml:
with open(f"{result.project_path}/.travis.yml", "r") as travis_yml:
try:
yml = yaml.safe_load(travis_yml)["jobs"]["include"]
assert yml[0]["script"] == ["flake8"]
@ -236,10 +241,10 @@ def test_gitlab_invokes_flake8_and_pytest(
assert result.exit_code == 0
assert result.exception is None
assert result.project.basename == context["project_slug"]
assert result.project.isdir()
assert result.project_path.name == context["project_slug"]
assert result.project_path.is_dir()
with open(f"{result.project}/.gitlab-ci.yml", "r") as gitlab_yml:
with open(f"{result.project_path}/.gitlab-ci.yml", "r") as gitlab_yml:
try:
gitlab_config = yaml.safe_load(gitlab_yml)
assert gitlab_config["flake8"]["script"] == ["flake8"]
@ -263,10 +268,10 @@ def test_github_invokes_linter_and_pytest(
assert result.exit_code == 0
assert result.exception is None
assert result.project.basename == context["project_slug"]
assert result.project.isdir()
assert result.project_path.name == context["project_slug"]
assert result.project_path.is_dir()
with open(f"{result.project}/.github/workflows/ci.yml", "r") as github_yml:
with open(f"{result.project_path}/.github/workflows/ci.yml", "r") as github_yml:
try:
github_config = yaml.safe_load(github_yml)
linter_present = False
@ -317,6 +322,6 @@ def test_pycharm_docs_removed(cookies, context, use_pycharm, pycharm_docs_exist)
context.update({"use_pycharm": use_pycharm})
result = cookies.bake(extra_context=context)
with open(f"{result.project}/docs/index.rst", "r") as f:
with open(f"{result.project_path}/docs/index.rst", "r") as f:
has_pycharm_docs = "pycharm/configuration" in f.read()
assert has_pycharm_docs is pycharm_docs_exist

View File

@ -10,7 +10,7 @@ repos:
- id: check-yaml
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.1.0
hooks:
- id: black

View File

@ -45,7 +45,10 @@ DATABASES = {"default": env.db("DATABASE_URL")}
{%- else %}
{% if cookiecutter.database_engine == 'postgresql' -%}
DATABASES = {
"default": env.db("DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}"),
"default": env.db(
"DATABASE_URL",
default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}",
),
}
{% elif cookiecutter.database_engine == 'mysql' -%}
DATABASES = {
@ -341,11 +344,11 @@ REST_FRAMEWORK = {
# django-cors-headers - https://github.com/adamchainz/django-cors-headers#setup
CORS_URLS_REGEX = r"^/api/.*$"
# By Default swagger ui is available only to admin user. You can change permission classs to change that
# By Default swagger ui is available only to admin user(s). You can change permission classes to change that
# See more configuration options at https://drf-spectacular.readthedocs.io/en/latest/settings.html#settings
SPECTACULAR_SETTINGS = {
"TITLE": "{{ cookiecutter.project_name }} API",
"DESCRIPTION": "Documentation of API endpoiints of {{ cookiecutter.project_name }}",
"DESCRIPTION": "Documentation of API endpoints of {{ cookiecutter.project_name }}",
"VERSION": "1.0.0",
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"],
"SERVERS": [

View File

@ -17,6 +17,7 @@ services:
dockerfile: ./compose/local/django/Dockerfile
image: {{ cookiecutter.project_slug }}_local_django
container_name: {{ cookiecutter.project_slug }}_local_django
platform: linux/x86_64
depends_on:
{%- if cookiecutter.database_engine == 'postgresql' %}
- postgres
@ -74,6 +75,7 @@ services:
docs:
image: {{ cookiecutter.project_slug }}_local_docs
container_name: {{ cookiecutter.project_slug }}_local_docs
platform: linux/x86_64
build:
context: .
dockerfile: ./compose/local/docs/Dockerfile

View File

@ -17,6 +17,7 @@ services:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: {{ cookiecutter.project_slug }}_production_django
platform: linux/x86_64
depends_on:
{%- if cookiecutter.database_engine == 'postgresql' %}
- postgres

View File

@ -1,6 +1,6 @@
pytz==2021.3 # https://github.com/stub42/pytz
python-slugify==5.0.2 # https://github.com/un33k/python-slugify
Pillow==9.0.0 # https://github.com/python-pillow/Pillow
Pillow==9.0.1 # https://github.com/python-pillow/Pillow
{%- if cookiecutter.use_compressor == "y" %}
{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}
rcssmin==1.1.0 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
@ -12,7 +12,7 @@ argon2-cffi==21.3.0 # https://github.com/hynek/argon2_cffi
{%- if cookiecutter.use_whitenoise == 'y' %}
whitenoise==5.3.0 # https://github.com/evansd/whitenoise
{%- endif %}
redis==4.1.2 # https://github.com/redis/redis-py
redis==4.1.3 # https://github.com/redis/redis-py
{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %}
hiredis==2.0.0 # https://github.com/redis/hiredis-py
{%- endif %}
@ -24,15 +24,15 @@ flower==1.0.0 # https://github.com/mher/flower
{%- endif %}
{%- endif %}
{%- if cookiecutter.use_async == 'y' %}
uvicorn[standard]==0.17.0.post1 # https://github.com/encode/uvicorn
uvicorn[standard]==0.17.4 # https://github.com/encode/uvicorn
{%- endif %}
# Django
# ------------------------------------------------------------------------------
django==3.2.11 # pyup: < 4.0 # https://www.djangoproject.com/
django==3.2.12 # pyup: < 4.0 # https://www.djangoproject.com/
django-environ==0.8.1 # https://github.com/joke2k/django-environ
django-model-utils==4.2.0 # https://github.com/jazzband/django-model-utils
django-allauth==0.47.0 # https://github.com/pennersr/django-allauth
django-allauth==0.48.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==1.14.0 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==0.6 # https://github.com/django-crispy-forms/crispy-bootstrap5
{%- if cookiecutter.use_compressor == "y" %}
@ -44,5 +44,5 @@ django-redis==5.2.0 # https://github.com/jazzband/django-redis
djangorestframework==3.13.1 # https://github.com/encode/django-rest-framework
django-cors-headers==3.11.0 # https://github.com/adamchainz/django-cors-headers
# DRF-spectacular for api documentation
drf-spectacular==0.21.1
drf-spectacular==0.21.2
{%- endif %}

View File

@ -1,6 +1,6 @@
-r base.txt
Werkzeug[watchdog]==2.0.2 # https://github.com/pallets/werkzeug
Werkzeug[watchdog]==2.0.3 # https://github.com/pallets/werkzeug
ipdb==0.13.9 # https://github.com/gotcha/ipdb
{%- if cookiecutter.database_engine == "postgresql" %}
{%- if cookiecutter.use_docker == 'y' %}
@ -20,7 +20,7 @@ watchgod==0.7 # https://github.com/samuelcolvin/watchgod
# ------------------------------------------------------------------------------
mypy==0.931 # https://github.com/python/mypy
django-stubs==1.9.0 # https://github.com/typeddjango/django-stubs
pytest==6.2.5 # https://github.com/pytest-dev/pytest
pytest==7.0.0 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar
{%- if cookiecutter.use_drf == "y" %}
djangorestframework-stubs==1.4.0 # https://github.com/typeddjango/djangorestframework-stubs
@ -35,8 +35,8 @@ sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild
# ------------------------------------------------------------------------------
flake8==4.0.1 # https://github.com/PyCQA/flake8
flake8-isort==4.1.1 # https://github.com/gforcada/flake8-isort
coverage==6.3 # https://github.com/nedbat/coveragepy
black==21.12b0 # https://github.com/psf/black
coverage==6.3.1 # https://github.com/nedbat/coveragepy
black==22.1.0 # https://github.com/psf/black
pylint-django==2.5.0 # https://github.com/PyCQA/pylint-django
{%- if cookiecutter.use_celery == 'y' %}
pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery