Skip to content

Commit c0367b9

Browse files
committed
Apply the new pypackage cookiecutter template
1 parent 98a1809 commit c0367b9

30 files changed

+771
-50
lines changed

.cookiecutter/cookiecutter.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"template": "https://github.com/hypothesis/cookiecutters",
3+
"directory": "pypackage",
4+
"ignore": ["INSTALL.md"],
5+
"extra_context": {
6+
"name": "tox-envfile",
7+
"package_name": "tox_envfile",
8+
"slug": "tox-envfile",
9+
"short_description": "Load env files in your tox envs.",
10+
"python_versions": "3.10.4, 3.9.12, 3.8.13",
11+
"github_owner": "hypothesis",
12+
"copyright_holder": "Hypothesis",
13+
"public": "yes",
14+
"console_script": "no",
15+
"__entry_point": "tox-envfile",
16+
"__github_url": "https://github.com/hypothesis/tox-envfile",
17+
"__pypi_url": "https://pypi.org/project/tox-envfile"
18+
}
19+
}

.cookiecutter/includes/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
tox-envfile reads environment variables from a file named `.devdata.env` in the
3+
same directory as your `tox.ini` file and adds them to the environment that tox
4+
runs your commands in.
5+
6+
This is a pretty dumb plugin for now: all of the environment variables in
7+
`.devdata.env` will be loaded into the environment for every tox env that you
8+
run, unconditionally. Any existing envvars with conflicting names will be
9+
overwritten. Only a single environment file is supported and it must be named
10+
`.devdata.env`.
11+
12+
env File Format
13+
---------------
14+
15+
[python-dotenv](https://saurabh-kumar.com/python-dotenv/) is used for the env file parsing.
16+
17+
The `.devdata.env` file should be an env file with contents that look like
18+
this:
19+
20+
```shell
21+
# a comment that will be ignored.
22+
REDIS_ADDRESS=localhost:6379
23+
MEANING_OF_LIFE=42
24+
MULTILINE_VAR="hello\nworld"
25+
```
26+
27+
Or like this:
28+
29+
```shell
30+
export S3_BUCKET=YOURS3BUCKET
31+
export SECRET_KEY=YOURSECRETKEYGOESHERE
32+
```
33+
34+
POSIX variable expansion works, using variables from the environment or from
35+
earlier lines in the env file:
36+
37+
```shell
38+
CONFIG_PATH=${HOME}/.config/foo
39+
DOMAIN=example.org
40+
EMAIL=admin@${DOMAIN}
41+
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tox =
2+
tox-envfile = tox_envfile
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-dotenv

.cookiecutter/includes/tox/deps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pluggy

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
day: "sunday"
8+
time: "00:00"
9+
timezone: "Europe/London"

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
on:
3+
push:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 1 * * *'
7+
jobs:
8+
Format:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Install Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.10'
16+
- run: python -m pip install tox
17+
- run: tox -e checkformatting
18+
Lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Install Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.10'
26+
- run: python -m pip install tox
27+
- run: tox -e lint
28+
Tests:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: ['3.10', '3.9', '3.8']
33+
name: Unit tests with Python ${{ matrix.python-version }}
34+
steps:
35+
- uses: actions/checkout@v3
36+
- name: Install Python
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
- run: python -m pip install tox
41+
- run: tox -e tests
42+
- name: Upload coverage file
43+
uses: actions/upload-artifact@v3
44+
with:
45+
name: coverage
46+
path: .coverage.*
47+
Coverage:
48+
needs: tests
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v3
52+
- name: Install Python
53+
uses: actions/setup-python@v4
54+
with:
55+
python-version: '3.10'
56+
- name: Download coverage files
57+
uses: actions/download-artifact@v3
58+
with:
59+
name: coverage
60+
- run: python -m pip install tox
61+
- run: tox -e coverage
62+
Functests:
63+
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
python-version: ['3.10', '3.9', '3.8']
67+
name: Functional tests with Python ${{ matrix.python-version }}
68+
steps:
69+
- uses: actions/checkout@v3
70+
- name: Install Python
71+
uses: actions/setup-python@v4
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
- run: python -m pip install tox
75+
- run: tox -e functests

.github/workflows/pypi.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: PyPI
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
PyPI:
7+
uses: hypothesis/workflows/.github/workflows/pypi.yml@main
8+
secrets: inherit

.gitignore

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
tox_envfile.egg-info
2-
*.pyc
3-
__pycache__
41
build
5-
dist
2+
coverage
3+
node_modules
4+
yarn-error.log
5+
.coverage*
6+
.tox
7+
*.egg-info
8+
*.pyc
9+
supervisord.log
10+
supervisord.pid
11+
.DS_Store
12+
.devdata.env

.python-version

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
3.10.4
2+
3.9.12
3+
3.8.13

0 commit comments

Comments
 (0)