Skip to content

Commit 9354b23

Browse files
committed
Simplifies PyPI deployment over Travis configuration
* Credits: audreyfeldroy#578
1 parent 0b9fef3 commit 9354b23

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

cookiecutter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"project_name": "Python Boilerplate",
66
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
77
"project_short_description": "Python Boilerplate contains all the boilerplate you need to create a Python package.",
8-
"pypi_username": "{{ cookiecutter.github_username }}",
98
"version": "0.1.0",
109
"use_pytest": "n",
1110
"use_pypi_deployment_with_travis": "y",

docs/prompts.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,13 @@ github_username
1919

2020
project_name
2121
The name of your new Python package project. This is used in documentation, so spaces and any characters are fine here.
22-
22+
2323
project_slug
2424
The namespace of your Python package. This should be Python import-friendly. Typically, it is the slugified version of project_name. Note: your PyPi project and Travis links will use project_slug, so change those in the README afterwards.
2525

2626
project_short_description
2727
A 1-sentence description of what your Python package does.
2828

29-
pypi_username
30-
Your Python Package Index account username.
31-
3229
version
3330
The starting version number of the package.
3431

@@ -48,9 +45,9 @@ add_pyup_badge
4845

4946
command_line_interface
5047
Whether to create a console script using Click. Console script entry point will match the project_slug. Options: ['Click', 'Argparse', 'No command-line interface']
51-
48+
5249
create_author_file
5350
Whether to create an authors file
54-
51+
5552
open_source_license
5653
Choose a `license <https://choosealicense.com/>`_. Options: [1. MIT License, 2. BSD license, 3. ISC license, 4. Apache Software License 2.0, 5. GNU General Public License v3, 6. Not open source]

{{cookiecutter.project_slug}}/.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
language: python
44
python:
5+
- 3.9
56
- 3.8
67
- 3.7
78
- 3.6
@@ -13,16 +14,14 @@ install: pip install -U tox-travis
1314
script: tox
1415

1516
{% if cookiecutter.use_pypi_deployment_with_travis == 'y' -%}
16-
# Assuming you have installed the travis-ci CLI tool, after you
17-
# create the Github repo and add it to Travis, run the
18-
# following command to finish PyPI deployment setup:
19-
# $ travis encrypt --add deploy.password
17+
# Create a new token PyPI token for your project via:
18+
# https://pypi.org/manage/account/token/
19+
# Then add it to the `PYPI_PASSWORD` environment variable in your Travis project settings:
20+
# https://travis-ci.com/github/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/settings
2021
deploy:
2122
provider: pypi
2223
distributions: sdist bdist_wheel
23-
user: {{ cookiecutter.pypi_username }}
24-
password:
25-
secure: PLEASE_REPLACE_ME
24+
user: "__token__"
2625
on:
2726
tags: true
2827
repo: {{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}

0 commit comments

Comments
 (0)