Skip to content

Commit

Permalink
Merge pull request #554 from cookiejar/release/1.2.3
Browse files Browse the repository at this point in the history
release/1.2.3
  • Loading branch information
Zethson committed Dec 13, 2020
2 parents 1713156 + 0f6cc5b commit 1f29422
Show file tree
Hide file tree
Showing 30 changed files with 225 additions and 100 deletions.
16 changes: 8 additions & 8 deletions .cookietemple.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
cookietemple_version: 0.1.0 # <<COOKIETEMPLE_NO_BUMP>>
cookietemple_version: '1.2.2 # <<COOKIETEMPLE_NO_BUMP>>'
domain: cli
language: python
full_name: Lukas Heumos, Philipp Ehmele
email: lukas.heumos@posteo.net
project_name: cookietemple
project_slug: cookietemple
project_slug_no_hyphen: cookietemple
project_short_description: A cookiecutter based project template creation tool supporting several domains and languages with linting and template sync support.
version: 1.2.2
license: MIT
version: 1.2.3
license: Apache2.0
template_version: '1.1.0 # <<COOKIETEMPLE_NO_BUMP>>'
template_handle: cli-python
github_username: cookiejar
creator_github_username: Zethson
is_github_repo: true
is_repo_private: false
is_github_orga: true
github_orga: cookiejar
full_name: Lukas Heumos, Philipp Ehmele
email: lukas.heumos@posteo.net
project_name: cookietemple
command_line_interface: Click
testing_library: pytest
template_version: 1.0.0 # <<COOKIETEMPLE_NO_BUMP>>
template_handle: cli-python
6 changes: 1 addition & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ assignees: ''

---

**Associated Template/Command/Core**

<!-- State the template handle or command. -->

**Is your feature request related to a problem? Please describe.**

<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when ... -->

**Describe the solution you'd like**
**Describe the solution you would like**

<!-- A clear and concise description of what you want to happen. -->

Expand Down
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/general_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ assignees: ''

---

**Associated Template/Command/Core**

<!-- State the template handle or command. -->

**Question**

<!-- Ask your question here. Please use the BUG template for bugs and the FEATURE REQUEST template for feature requests. -->
<!-- Please ask your question here. It can be about the usage of this project, the internals, the implementation or whatever interests you.
Please use the BUG template for bugs and the FEATURE REQUEST template for feature requests. -->
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ updates:
- dependabot
commit-message:
prefix: "[DEPENDABOT]"

- package-ecosystem: github-actions
directory: "/"
schedule:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build Cookietemple Package
name: Build cookietemple Package

on: [push, pull_request]

jobs:
Build-Package:
build:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
Expand Down Expand Up @@ -36,4 +36,3 @@ jobs:

- name: Check twine package
run: twine check dist/*

2 changes: 1 addition & 1 deletion .github/workflows/check_no_SNAPSHOT_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/setup-python@v2.1.4
with:
python-version: 3.8

# PRs to the repository master branch are only ok if coming from any patch or release branch
- name: Install cookietemple
run: pip install cookietemple
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check_patch_release_master_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR to master branch from PATCH/release branch only

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
# PRs to the repository master branch are only ok if coming from any patch or release branch
- name: Check PRs
run: |
{ [[ $GITHUB_HEAD_REF = *"release"* ]]; } || [[ $GITHUB_HEAD_REF == *"patch"* ]]
# If the above check failed, post a comment on the PR explaining the failure
# NOTE - this may not work if the PR is coming from a fork, due to limitations in GitHub actions secrets
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
Hi @${{ github.event.pull_request.user.login }},
It looks like this pull-request is has been made against the ${{github.event.pull_request.head.repo.full_name}} `master` branch.
The `master` branch should always contain code from the latest release.
Because of this, PRs to `master` are only allowed if they come from any ${{github.event.pull_request.head.repo.full_name}} `release` or `patch` branch.
You do not need to close this PR, you can change the target branch to `development` by clicking the _"Edit"_ button at the top of this page.
Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false

2 changes: 1 addition & 1 deletion .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Cookietemple to PyPI
name: Publish cookietemple to PyPI

on:
release:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
#TODO COOKIETEMPLE: Remove this when Cookietemple goes public!
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion .github/workflows/run_tox_testsuite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Cookietemple Tox Test Suite
name: Run cookietemple Tox Test Suite

on: [push, pull_request]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: 'zethson'
email: 'lukas.heumos@posteo.net'
actor: 'zethson'
token: '${{ secrets.CT_SYNC_TOKEN}}'
token: '${{ secrets.CT_SYNC_TOKEN }}'

- name: Sync project
run: cookietemple sync . ${{ secrets.CT_SYNC_TOKEN }} zethson
31 changes: 27 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -40,12 +43,14 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

Expand All @@ -56,6 +61,8 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -73,22 +80,38 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# dotenv
# Environments
.env

# virtualenv
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ Changelog

This project adheres to `Semantic Versioning <https://semver.org/>`_.

1.2.3 (2020-12-13)
------------------

**Added**

* the sync PR is now always created from a new, temporary sync branch and not from TEMPLATE branch anymore

**Fixed**

* fixed a bug, that causes blacklisted files to be synced
* fixed a bug, where changes made to blacklisted files during sync were not discarded
* fixed a bug, when creating a project with a path parameter named like the project caused a move

**Dependencies**

**Deprecated**


1.2.2 (2020-12-06)
------------------

Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ RUN apk add make automake gcc g++ git
RUN pip install cookietemple

CMD cookietemple

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ ifeq ($(OS),Windows_NT)
include makefiles/Windows.mk
else
include makefiles/Linux.mk
endif
endif
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
:target: https://zenodo.org/badge/latestdoi/202421008
:alt: Zenodo ID

.. image:: https://zenodo.org/badge/202421008.svg
:target: https://zenodo.org/badge/latestdoi/202421008
:alt: Zenodo ID

.. image:: https://img.shields.io/discord/708008788505919599?color=passing&label=Discord%20Chat&style=flat-square
:target: https://discord.gg/PYF8NUk
:alt: Discord
Expand Down
10 changes: 7 additions & 3 deletions cookietemple.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
[bumpversion]
current_version = 1.2.2
current_version = 1.2.3

[bumpversion_files_whitelisted]
init_file = cookietemple/__init__.py
setup_file = setup.py
init_file = cookietemple/__init__.py
dot_cookietemple = .cookietemple.yml
conf_py = docs/conf.py

[bumpversion_files_blacklisted]

[sync_level]
ct_sync_level = patch
ct_sync_level = minor

[sync_files_blacklisted]
changelog = CHANGELOG.rst
requirements = requirements.txt
requirements_dev = requirements_dev.txt
tests = tests/**/*
docs = docs/**/*

11 changes: 1 addition & 10 deletions cookietemple/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
# -*- coding: utf-8 -*-
# try:
# from importlib import metadata
# except ImportError:
# Running on pre-3.8 Python; use importlib-metadata package
# import importlib_metadata as metadata

# __version__ = metadata.version('cookietemple')

__version__ = '1.2.2'
__version__ = '1.2.3'
4 changes: 3 additions & 1 deletion cookietemple/create/template_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def process_common_operations(self, path: Path, skip_common_files=False, skip_fi
console.print('[bold blue]Please visit: https://cookietemple.readthedocs.io/en/latest/available_templates/available_templates.html'
f'#{domain}-{language} for more information about how to use your chosen template.')

if path != Path.cwd():
cwd = Path.cwd()
# do not move if path is current working directory or a directory named like the project in the current working directory (second is default case)
if path != cwd and path != Path(cwd/self.creator_ctx.project_slug_no_hyphen):
shutil.move(f'{Path.cwd()}/{self.creator_ctx.project_slug_no_hyphen}', f'{path}/{self.creator_ctx.project_slug_no_hyphen}')

def create_template_without_subdomain(self, domain_path: str) -> None:
Expand Down

0 comments on commit 1f29422

Please sign in to comment.