Skip to content

Commit

Permalink
chore(Travis): Remove support for Travis #18
Browse files Browse the repository at this point in the history
Travis is quite expensive and the free tier is only for a trial.
Continue developing GitHub actions for build and deploy.

closes #18
  • Loading branch information
imAsparky committed Sep 1, 2021
1 parent aa463f4 commit ade1959
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 205 deletions.
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion README.rst
Expand Up @@ -38,6 +38,11 @@ Cookiecutter_ template for a Python package.
**The information below relates to the original package and has not been
updated yet**

**Notable Fork changes from the Original project so far.**

#. Links from the original fork have been updated to point to this repository.
#. Support for Travis has been removed.

Features
--------

Expand Down Expand Up @@ -116,7 +121,7 @@ Similar Cookiecutter Templates

* `zillionare/cookiecutter-pypackage`_: A template containing Poetry_, Mkdocs_, Github CI and many more. It's a template and a package also (can be installed with `pip`)

* Also see the `network`_ and `family tree`_ for this repo. (If you find
* Also see the `network`_ and `family tree`_ for the original repo. (If you find
anything that should be listed here, please add it and send a pull request!)

Fork This / Create Your Own
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Expand Up @@ -30,7 +30,6 @@ Advanced Features
.. toctree::
:maxdepth: 2

travis_pypi_setup
console_script_setup


Expand Down
27 changes: 16 additions & 11 deletions docs/prompts.rst
Expand Up @@ -18,10 +18,13 @@ github_username
Your GitHub username.

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

The name of your new Python package project. This is used in documentation,
so spaces and any characters are fine here.

project_slug
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.
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 link will use project_slug, so change those in the README afterwards.

project_short_description
A 1-sentence description of what your Python package does.
Expand All @@ -35,22 +38,24 @@ version
Options
-------

The following package configuration options set up different features for your project.
The following package configuration options set up different features for your
project.

use_pytest
Whether to use `pytest <https://docs.pytest.org/en/latest/>`_

use_pypi_deployment_with_travis
Whether to use PyPI deployment with `Travis <https://travis-ci.org/>`_.

add_pyup_badge
Whether to include a `pyup <https://github.com/pyupio/pyup>`_ badge

command_line_interface
Whether to create a console script using Click. Console script entry point will match the project_slug. Options: ['Click', 'Argparse', 'No command-line interface']

Whether to create a console script using Click. Console script entry point
will match the project_slug. Options: ['Click', 'Argparse',
'No command-line interface']

create_author_file
Whether to create an authors file

open_source_license
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]
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]
62 changes: 0 additions & 62 deletions docs/travis_pypi_setup.rst

This file was deleted.

46 changes: 26 additions & 20 deletions docs/tutorial.rst
Expand Up @@ -62,11 +62,15 @@ If you don't know what to enter, stick with the defaults.
Step 3: Create a GitHub Repo
----------------------------

Go to your GitHub account and create a new repo named ``mypackage``, where ``mypackage`` matches the ``[project_slug]`` from your answers to running cookiecutter. This is so that Travis CI and pyup.io can find it when we get to Step 5.
Go to your GitHub account and create a new repo named ``mypackage``, where
``mypackage`` matches the ``[project_slug]`` from your answers to running
cookiecutter. This is so that pyup.io can find it when we get to Step 5.

``If your virtualenv folder is within your project folder, be sure to add the virtualenv folder name to your .gitignore file.``
``If your virtualenv folder is within your project folder, be sure to add the
virtualenv folder name to your .gitignore file.``

You will find one folder named after the ``[project_slug]``. Move into this folder, and then setup git to use your GitHub repo and upload the code:
You will find one folder named after the ``[project_slug]``. Move into this f
older, and then setup git to use your GitHub repo and upload the code:

.. code-block:: bash
Expand All @@ -90,39 +94,41 @@ Step 4: Install Dev Requirements

You should still be in the folder containing the ``requirements_dev.txt`` file.

Your virtualenv should still be activated. If it isn't, activate it now. Install the new project's local development requirements:
Your virtualenv should still be activated. If it isn't, activate it now.
Install the new project's local development requirements:

.. code-block:: bash
pip install -r requirements_dev.txt
Step 5: Set Up Travis CI
------------------------
.. TODO: Change this to Codacy Step. See Issue 22
.. Step 5: Set Up Travis CI
.. ------------------------
`Travis CI com`_ is a continuous integration tool used to prevent integration problems. Every commit to the master branch will trigger automated builds of the application.
.. `Travis CI com`_ is a continuous integration tool used to prevent integration problems. Every commit to the master branch will trigger automated builds of the application.
Login using your Github credentials. It may take a few minutes for Travis CI to load up a list of all your GitHub repos. They will be listed with boxes to the left of the repo name, where the boxes have an ``X`` in them, meaning it is not connected to Travis CI.
.. Login using your Github credentials. It may take a few minutes for Travis CI to load up a list of all your GitHub repos. They will be listed with boxes to the left of the repo name, where the boxes have an ``X`` in them, meaning it is not connected to Travis CI.
Add the public repo to your Travis CI account by clicking the ``X`` to switch it "on" in the box next to the ``mypackage`` repo. Do not try to follow the other instructions, that will be taken care of next.
.. Add the public repo to your Travis CI account by clicking the ``X`` to switch it "on" in the box next to the ``mypackage`` repo. Do not try to follow the other instructions, that will be taken care of next.
In your terminal, your virtualenv should still be activated. If it isn't, activate it now. Run the Travis CLI tool to do your Travis CI setup:
.. In your terminal, your virtualenv should still be activated. If it isn't, activate it now. Run the Travis CLI tool to do your Travis CI setup:
.. code-block:: bash
.. .. code-block:: bash
travis encrypt --add deploy.password
.. travis encrypt --add deploy.password
This will:
.. This will:
* Encrypt your PyPI password in your Travis config.
* Activate automated deployment on PyPI when you push a new tag to master branch.
.. * Encrypt your PyPI password in your Travis config.
.. * Activate automated deployment on PyPI when you push a new tag to master branch.
See :ref:`travis-pypi-setup` for more information.
.. See :ref:`travis-pypi-setup` for more information.
.. _`Travis CI com`: https://travis-ci.com/
.. .. _`Travis CI com`: https://travis-ci.com/
Step 6: Set Up Read the Docs
Step 5: Set Up Read the Docs
--------------------------

`Read the Docs`_ hosts documentation for the open source community. Think of it as Continuous Documentation.
Expand All @@ -135,7 +141,7 @@ Now your documentation will get rebuilt when you make documentation changes to y

.. _`Read the Docs`: https://readthedocs.org/

Step 7: Set Up pyup.io
Step 6: Set Up pyup.io
----------------------

`pyup.io`_ is a service that helps you to keep your requirements files up to date. It sends you automated
Expand All @@ -150,7 +156,7 @@ Once your repo is set up correctly, the pyup.io badge will show your current upd

.. _`pyup.io`: https://pyup.io/

Step 8: Release on PyPI
Step 7: Release on PyPI
-----------------------

The Python Package Index or `PyPI`_ is the official third-party software repository for the Python programming language. Python developers intend it to be a comprehensive catalog of all open source Python packages.
Expand Down
51 changes: 8 additions & 43 deletions tests/test_bake_project.py
@@ -1,16 +1,15 @@
from contextlib import contextmanager
import shlex
import datetime
import importlib
import os
import sys
import shlex
import subprocess
import yaml
import datetime
import pytest
from cookiecutter.utils import rmtree
import sys
from contextlib import contextmanager

import pytest
import yaml
from click.testing import CliRunner

import importlib
from cookiecutter.utils import rmtree


@contextmanager
Expand Down Expand Up @@ -112,40 +111,6 @@ def test_bake_with_apostrophe_and_run_tests(cookies):
run_inside_dir('python setup.py test', str(result.project)) == 0


# def test_bake_and_run_travis_pypi_setup(cookies):
# # given:
# with bake_in_temp_dir(cookies) as result:
# project_path = str(result.project)
#
# # when:
# travis_setup_cmd = ('python travis_pypi_setup.py'
# ' --repo audreyr/cookiecutter-pypackage'
# ' --password invalidpass')
# run_inside_dir(travis_setup_cmd, project_path)
# # then:
# result_travis_config = yaml.load(
# result.project.join(".travis.yml").open()
# )
# min_size_of_encrypted_password = 50
# assert len(
# result_travis_config["deploy"]["password"]["secure"]
# ) > min_size_of_encrypted_password


def test_bake_without_travis_pypi_setup(cookies):
with bake_in_temp_dir(
cookies,
extra_context={'use_pypi_deployment_with_travis': 'n'}
) as result:
result_travis_config = yaml.load(
result.project.join(".travis.yml").open(),
Loader=yaml.FullLoader
)
assert "deploy" not in result_travis_config
assert "python" == result_travis_config["language"]
# found_toplevel_files = [f.basename for f in result.project.listdir()]


def test_bake_without_author_file(cookies):
with bake_in_temp_dir(
cookies,
Expand Down
7 changes: 0 additions & 7 deletions tox.ini
Expand Up @@ -4,13 +4,6 @@ envlist = py36, py37,py38 pypy, py39, docs
skipsdist = true
skip_missing_interpreters = true

[travis]
python =
3.9: py39
3.8: py38
3.7: py37
3.6: py36

[testenv:docs]
basepython=python
changedir=docs/source
Expand Down
30 changes: 0 additions & 30 deletions {{cookiecutter.project_slug}}/.travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions {{cookiecutter.project_slug}}/CONTRIBUTING.rst
Expand Up @@ -102,9 +102,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
https://travis-ci.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/pull_requests
and make sure that the tests pass for all supported Python versions.
3. The pull request should work for Python 3.5, 3.6, 3.7, 3.8, 3.9 and PyPy.

Tips
----
Expand All @@ -127,5 +125,3 @@ Then run::
$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags

Travis will then deploy to PyPI if tests pass.

0 comments on commit ade1959

Please sign in to comment.