Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Alpine test environment to tox #1337

Merged
merged 3 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
env: TOXENV=pypy3
- python: 3.7
env: TOXENV=32bit TEST_32BIT=1
- python: 3.7
env: TOXENV=alpine TEST_ALPINE=1

install:
- pip install tox
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ global-exclude *.py[cod] __pycache__ *.so
exclude Makefile tox.ini .coveragerc .bumpversion.cfg .dockerignore .isort.cfg
exclude ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md
exclude appveyor.yml readthedocs.yml
exclude build-alpine.sh
exclude build32bit.sh
prune docs
prune .circleci
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Faker is heavily inspired by `PHP Faker`_, `Perl Faker`_, and by `Ruby Faker`_.
Compatibility
-------------

Starting from version ``4.0.0``, ``Faker`` dropped support for Python 2 and only supports Python
3.5 and above. If you still need Python 2 compatibility, please install version ``3.0.1`` in the
Starting from version ``5.0.0``, ``Faker`` dropped support for Python 2 and only supports Python
3.6 and above. If you still need Python 2 compatibility, please install version ``3.0.1`` in the
meantime, and please consider updating your codebase to support Python 3 so you can enjoy the
latest features ``Faker`` has to offer. Please see the `extended docs`_ for more details, especially
if you are upgrading from version ``2.0.4`` and below as there might be breaking changes.
Expand Down
15 changes: 15 additions & 0 deletions build-alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

if [[ -z "${TEST_ALPINE}" ]]; then
echo "Not on Travis"
exit 0
fi

docker run -v ${PWD}:/code -e INSTALL_REQUIREMENTS=${INSTALL_REQUIREMENTS} python:3-alpine sh -c "
apk update \
&& apk add git \
&& pip install tox coveralls \
&& export LANG='en_US.UTF-8' \
&& cd /code \
&& tox -e py\
&& coverage report"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand All @@ -62,7 +62,7 @@
packages=find_packages(exclude=excluded_packages),
platforms=["any"],
zip_safe=zip_safe,
python_requires=">=3.5",
python_requires=">=3.6",
install_requires=[
"python-dateutil>=2.4",
"text-unidecode==1.3",
Expand Down
13 changes: 9 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tox]
envlist=py{35,36,37,38,py3},32bit,flake8,checkmanifest,isort
envlist=py{36,37,38,39,py3},32bit,alpine,flake8,checkmanifest,isort
skip_missing_interpreters = true

[testenv]
deps =
coverage
coverage>=5.2
freezegun<0.4
pytest>=6.0.1
random2
random2>=1.0.1
ukpostcodeparser>=1.1.1
validators>=0.13.0
sphinx>=2.4,<3.0
Expand Down Expand Up @@ -43,6 +43,11 @@ basepython = python
passenv = TEST_32BIT
commands = ./build32bit.sh

[testenv:alpine]
basepython = python
passenv = TEST_ALPINE
commands = ./build-alpine.sh

[flake8]
max-line-length = 120

Expand All @@ -51,4 +56,4 @@ ignore =
faker/sphinx
faker/sphinx/*
tests/sphinx
tests/sphinx/*
tests/sphinx/*