Skip to content

Commit abadbea

Browse files
🐞 fix: init git failed with --global
1. init git may fail due to specified with --global option, now replaced by --system 2. remove ppw's author info from cookiecutter.json 3. add .history to .gitignore 4. update python to >=3.7,<4.0 5. rename project as python-project-wizard
1 parent d1e8e68 commit abadbea

31 files changed

+281
-167
lines changed

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name: dev CI workflow
44

5-
# Controls when the action will run.
5+
# Controls when the action will run.
66
on:
77
# Triggers the workflow on push or pull request events but only for the master branch
88
push:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,5 @@ cookiecutter-pypackage-env/
101101
.vscode/
102102

103103
# mkdocs
104-
site/
104+
site/
105+
.history/

.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
repos:
2+
- repo: https://github.com/Lucas-C/pre-commit-hooks
3+
rev: v1.1.13
4+
hooks:
5+
- id: forbid-crlf
6+
- id: remove-crlf
7+
- id: forbid-tabs
8+
- id: remove-tabs
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v4.2.0
11+
hooks:
12+
- id: trailing-whitespace
13+
- id: end-of-file-fixer
14+
- id: check-merge-conflict
15+
- id: check-yaml
16+
args: [--unsafe]
17+
- repo: https://github.com/pre-commit/mirrors-isort
18+
rev: v5.10.1
19+
hooks:
20+
- id: isort
21+
- repo: https://github.com/ambv/black
22+
rev: 22.3.0
23+
hooks:
24+
- id: black
25+
language_version: python3.8
26+
- repo: https://gitlab.com/pycqa/flake8
27+
rev: 3.9.2
28+
hooks:
29+
- id: flake8
30+
additional_dependencies: [flake8-typing-imports==1.10.0]

CONTRIBUTING.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,3 @@ To write and run your new test, follow these steps:
233233
.. cookiecutter: https://github.com/audreyr/cookiecutter-pypackage
234234
.. virtualenv: https://virtualenv.pypa.io/en/stable/installation
235235
.. git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
236-

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Python Project Wizard
22

3-
A tool for creating skeleton python project, built with popular develop tools and
3+
A tool for creating skeleton python project, built with popular develop tools and
44
conform to best practice.
55

66
[![Version](http://img.shields.io/pypi/v/ppw?color=brightgreen)](https://pypi.python.org/pypi/ppw)
7-
[![CI Status](https://github.com/zillionare/cookiecutter-pypackage/actions/workflows/release.yml/badge.svg)](https://github.com/zillionare/cookiecutter-pypackage)
7+
[![CI Status](https://github.com/zillionare/python-project-wizard/actions/workflows/release.yml/badge.svg)](https://github.com/zillionare/python-project-wizard)
88
[![Dowloads](https://img.shields.io/pypi/dm/ppw)](https://pypi.org/project/ppw/)
99
[![License](https://img.shields.io/pypi/l/ppw)](https://opensource.org/licenses/BSD-2-Clause)
1010
![Python Versions](https://img.shields.io/pypi/pyversions/ppw)
@@ -44,7 +44,7 @@ Generate a Python package project by simple run:
4444
ppw
4545
```
4646

47-
Then follow **[Tutorial](https://zillionare.github.io/cookiecutter-pypackage/tutorial/)** to finish other configurations.
47+
Then follow **[Tutorial](https://zillionare.github.io/python-project-wizard/tutorial/)** to finish other configurations.
4848

4949
# Credits
5050

@@ -65,3 +65,7 @@ This repo is forked from [audreyr/cookiecutter-pypackage](https://github.com/aud
6565
[github actions]: https://github.com/features/actions
6666
[Git Pages]: https://pages.github.com
6767
[Pre-commit hooks]: https://pre-commit.com/
68+
69+
# More projects by same author
70+
## cfg4py
71+
[cfg4py](https://pypi.org/project/cfg4py/) is a great tool for managing configuration files, supporting configuration for different environments (dev, prodction and test), automatically converting yaml-based configuration to python class, so you can access configuration items by attribute, thus enable auto-completion (by IDE). It also support live-reload, remote central configuration, config template and more.

cookiecutter.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"full_name": "Aaron Yang",
3-
"email": "code@jieyu.ai",
4-
"github_username": "zillionare",
2+
"full_name": "",
3+
"email": "",
4+
"github_username": "",
55
"project_name": "Python Boilerplate",
66
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
77
"project_short_description": "Skeleton project created by Python Project Wizard (ppw)",

docs/faq.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#sinceTag: v0.1.1
2020
output: CHANGELOG.md
2121
```
22-
uncomment `#sinceTag` line and given an existed tag name in your project. If
22+
uncomment `#sinceTag` line and given an existed tag name in your project. If
2323
there's none, you have to create one now.
2424

2525
???+ Question
@@ -35,51 +35,51 @@
3535

3636
???+ Question
3737
# Why mkdocs over sphinx?
38-
reStructured Text and Sphinx is way to tedious, though powerful. With extension,
39-
you'll find almost all features are available in mkdocs, in a neat and productive
38+
reStructured Text and Sphinx is way to tedious, though powerful. With extension,
39+
you'll find almost all features are available in mkdocs, in a neat and productive
4040
way. Poetry and Markdown, are the two key factors driven me develop this template.
4141

4242
???+ Question
4343
# What are the configuration items?
44-
44+
4545
Here is a list:
4646

4747
```
4848
## Templated Values
4949

5050
The following appear in various parts of your generated project.
5151

52-
full_name
52+
full_name
5353
Your full name.
5454

55-
email
55+
email
5656
Your email address.
5757

58-
github_username
58+
github_username
5959
Your GitHub username.
6060

61-
project_name
61+
project_name
6262
The name of your new Python package project. This is used in
6363
documentation, so spaces and any characters are fine here.
6464

65-
project_slug
65+
project_slug
6666
The namespace of your Python package. This should be Python
6767
import-friendly. Typically, it is the slugified version of
6868
project_name.
6969

70-
project_short_description
70+
project_short_description
7171
A 1-sentence description of what your Python package does.
7272

73-
release_date
73+
release_date
7474
The date of the first release.
7575

76-
pypi_username
76+
pypi_username
7777
Your Python Package Index account username.
7878

79-
year
79+
year
8080
The year of the initial package copyright in the license file.
8181

82-
version
82+
version
8383
The starting version number of the package.
8484

8585
install_precommit_hooks
@@ -93,7 +93,7 @@
9393
The following package configuration options set up different features
9494
for your project.
9595

96-
command_line_interface
96+
command_line_interface
9797
Whether to create a console script using Python Fire. Console script
9898
entry point will match the project_slug. Options: \['fire', "No
9999
command-line interface"\]
@@ -105,3 +105,12 @@
105105
- PERSONAL_TOKEN (required for publishing document to git pages)
106106
- TEST_PYPI_API_TOKEN (required for publishing dev release to testpypi)
107107
- PYPI_API_TOKEN (required for publish )
108+
109+
???+ Question
110+
# first launch of pre-commit failed
111+
112+
first time launch `pre-commit run` failed with error: "[WARNING] The 'rev' field of
113+
repo 'https://github.com/ambv/black' appears to be a mutable reference
114+
(moving tag / branch)"
115+
116+
Please follow the instructions to update pre-commit then run again.

docs/history.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@
3232
[github actions]: https://github.com/features/actions
3333
[Git Pages]: https://pages.github.com
3434
[Pre-commit hooks]: https://pre-commit.com/
35-

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{%
22
include-markdown "../README.md"
3-
%}
3+
%}

docs/tutorial.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
??? Note
44
Did you find this article confusing? [Edit this file] and pull a request!
55

6-
To start with, you will need [GitHub], [Pypi] , [TestPyPi] and [Codecov] account. If
7-
you don't have one, please follow the links to apply one before you get started on this
8-
tutorial.
6+
To start with, you will need [GitHub], [Pypi] , [TestPyPi] and [Codecov] account. If
7+
you don't have one, please follow the links to apply one before you get started on this
8+
tutorial.
99

1010
If you are new to Git and GitHub, you should probably spend a few minutes on
1111
some of the tutorials at the top of the page at [GitHub Help]
@@ -81,10 +81,10 @@ Also be noticed that there's pyproject.toml in this folder. This is the main
8181
configuration file of our project.
8282

8383
## Step 3: Build a virtual environment for your development
84-
Now build a virtual python environment for your development, and develop your project
84+
Now build a virtual python environment for your development, and develop your project
8585
always in that environment from now on.
8686

87-
You can choose either annaconda or virtualenv. I prefer annaconda (actually miniconda)
87+
You can choose either annaconda or virtualenv. I prefer annaconda (actually miniconda)
8888
though.
8989

9090
```
@@ -93,7 +93,7 @@ conda activate mypackage
9393
conda install -c conda-forge tox-conda
9494
```
9595

96-
You could choose your favorite python version here.
96+
You could choose your favorite python version here.
9797
## Step 4: Install Dev Requirements
9898

9999
You should still be in the folder named as `%proejct_slug`, which containing the
@@ -109,16 +109,16 @@ tox
109109
```
110110

111111
We start with install poetry, since the whole project is managed by poetry. Then we
112-
installed extra dependency need by developer, such as documentation build tools, lint,
112+
installed extra dependency need by developer, such as documentation build tools, lint,
113113
formatting and test tools etc.
114114

115115
We also launch a smoke test here by running `tox`. This will give you a test report and
116116
lint report. You should see no errors except some lint warnings.
117117

118118
??? Tips
119119

120-
Extra dependencies are grouped into three groups, doc, dev and test for better
121-
granularity. When you ship the package, dependencies in group doc, dev and test
120+
Extra dependencies are grouped into three groups, doc, dev and test for better
121+
granularity. When you ship the package, dependencies in group doc, dev and test
122122
might not be shipped.
123123

124124
As the developer, you will need install all the dependencies.
@@ -151,7 +151,7 @@ Then goto repo > settings > secrets, click on 'New repository secret', add the f
151151

152152
???+ Tips
153153

154-
If you have already setup codecov integration and configured access for all your
154+
If you have already setup codecov integration and configured access for all your
155155
repositories, you can skip this step.
156156

157157
In your browser, visit [install codecov app], you'll be landed at this page:
@@ -163,7 +163,7 @@ on `install` button, following directions until all set.
163163

164164
## Step 7: Upload code to github
165165

166-
Back to your develop environment, find the folder named after the `[project_slug]`.
166+
Back to your develop environment, find the folder named after the `[project_slug]`.
167167
Move into this folder, and then setup git to use your GitHub repo and upload the
168168
code:
169169

@@ -185,7 +185,7 @@ You'll need a ssh key to push the repo. You can [Generate] a key or
185185

186186
???+ Warning
187187

188-
if you answered 'yes' to the question if install pre-commit hooks at last step,
188+
if you answered 'yes' to the question if install pre-commit hooks at last step,
189189
then you should find pre-commit be invoked when you run `git commit`, and some files
190190
may be modified by hooks. If so, please add these files and **commit again**.
191191

@@ -201,7 +201,7 @@ new artifact is published under the name {{ cookiecutter.project_slug }}
201201

202202
## Step 8. Check documentation
203203

204-
Documentation will be published and available at
204+
Documentation will be published and available at
205205
<https://{your_github_account}.github.io/{your_repo}> once:
206206

207207
1. the branch is release
@@ -218,7 +218,7 @@ new artifact is published under the name {{ cookiecutter.project_slug }}
218218

219219
## Step 9. Make official release
220220

221-
After done with your phased development, switch to releas branch, following
221+
After done with your phased development, switch to releas branch, following
222222
instructions at [release checklist](/pypi_release_checklist), trigger first official release and check
223223
result at [PYPI].
224224

0 commit comments

Comments
 (0)