Skip to content

Commit 10e3cf2

Browse files
authored
Project clean up and maintenance (#11)
1 parent bd7117d commit 10e3cf2

File tree

11 files changed

+381
-94
lines changed

11 files changed

+381
-94
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"

.github/workflows/ci.yml

+31-40
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,65 @@ on:
88
name: CI
99

1010
jobs:
11-
1211
test:
1312
runs-on: ubuntu-latest
1413
strategy:
1514
matrix:
1615
python:
17-
- '3.11'
18-
- '3.10'
19-
- '3.9'
20-
- '3.8'
21-
name: Python ${{ matrix.python }}
16+
- version: '3.12'
17+
- version: '3.11'
18+
- version: '3.10'
19+
- version: '3.9'
20+
exclude-pattern-matching: true
21+
- version: '3.8'
22+
exclude-pattern-matching: true
23+
name: Python ${{ matrix.python.version }}
2224
steps:
23-
# Python
24-
- name: Setup python ${{ matrix.python }}
25-
uses: actions/setup-python@v2
26-
with:
27-
python-version: ${{ matrix.python }}
28-
2925
# Check out code
30-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
3127

32-
# Cached dependencies
33-
- uses: actions/cache@v1
28+
# Python
29+
- name: Setup python ${{ matrix.python.version }}
30+
uses: actions/setup-python@v5
3431
with:
35-
path: ~/.cache/pip
36-
key: ${{ runner.os }}-pip-py${{ matrix.python }}-${{ hashFiles('**/requirements-dev.txt') }}
37-
restore-keys: |
38-
${{ runner.os }}-pip-py${{ matrix.python }}-
32+
python-version: ${{ matrix.python.version }}
33+
cache: pip
34+
cache-dependency-path: requirements-dev.txt
35+
3936
- name: Install dev dependencies
40-
run: pip install --requirement requirements-dev.txt
37+
run: pip install --root-user-action=ignore --requirement requirements-dev.txt
4138

4239
# Install library
4340
- name: Install maybe
44-
run: pip install --editable .
41+
run: pip install --root-user-action=ignore --editable .
4542

4643
# Tests
47-
- name: Run tests
48-
run: pytest --ignore=tests/test_pattern_matching.py --ignore=tests/type-checking/test_maybe.yml
49-
- name: Run tests (type checking)
50-
if: matrix.python != '3.8' && matrix.python != '3.9'
51-
# These started breaking for <= 3.9, due to the type checker using a
52-
# '|' for unions rather than 'Union[...]', so it's not possible to run
53-
# the tests without maintaining two duplicate files (one for <= 3.9 and
54-
# one for > 3.9)
55-
run: pytest tests/type-checking/test_maybe.yml
56-
- name: Run tests (pattern matching)
57-
if: matrix.python == '3.10' || matrix.python == '3.11'
58-
run: pytest tests/test_pattern_matching.py
44+
- name: Run tests (excluding pattern matching)
45+
if: ${{ matrix.python.exclude-pattern-matching }}
46+
run: pytest --ignore=tests/test_pattern_matching.py
47+
- name: Run tests (including pattern matching)
48+
if: ${{ ! matrix.python.exclude-pattern-matching }}
49+
run: pytest
5950

6051
# Linters
61-
- name: Run flake8 (Python >= 3.10)
62-
run: flake8
63-
if: matrix.python != '3.9' && matrix.python != '3.8'
64-
- name: Run flake8 (Python < 3.10)
52+
- name: Run flake8 (excluding pattern matching)
53+
if: ${{ matrix.python.exclude-pattern-matching }}
6554
run: flake8 --extend-exclude tests/test_pattern_matching.py
66-
if: matrix.python == '3.9' || matrix.python == '3.8'
55+
- name: Run flake8 (including pattern matching)
56+
if: ${{ ! matrix.python.exclude-pattern-matching }}
57+
run: flake8
6758
- name: Run mypy
6859
run: mypy
6960

7061
# Packaging
7162
- name: Build packages
7263
run: |
73-
pip install --upgrade build pip setuptools wheel
64+
pip install --root-user-action=ignore --upgrade build pip setuptools wheel
7465
python -m build
7566
7667
# Coverage
7768
- name: Upload coverage to codecov.io
78-
uses: codecov/codecov-action@v1
69+
uses: codecov/codecov-action@v4
7970
if: matrix.python == '3.9'
8071
with:
8172
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+272-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,275 @@
1-
.cache/
2-
.coverage
3-
coverage.xml
4-
*.swp
5-
*.pyc
6-
__pycache__
1+
# Created by https://www.toptal.com/developers/gitignore/api/python
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
3+
4+
### Python ###
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
714
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
825
*.egg-info/
9-
build/
10-
.idea/
11-
.mypy_cache/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# IPython
56+
profile_default/
57+
ipython_config.py
58+
59+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
60+
__pypackages__/
61+
62+
# Environments
63+
.env
64+
.venv
65+
env/
1266
venv/
13-
/.tox/
67+
ENV/
68+
env.bak/
69+
venv.bak/
70+
71+
# Spyder project settings
72+
.spyderproject
73+
.spyproject
74+
75+
# Rope project settings
76+
.ropeproject
77+
78+
# mkdocs documentation
79+
/site
80+
81+
# mypy
82+
.mypy_cache/
83+
.dmypy.json
84+
dmypy.json
85+
86+
# Pyre type checker
87+
.pyre/
88+
89+
# pytype static type analyzer
90+
.pytype/
91+
92+
# Cython debug symbols
93+
cython_debug/
94+
95+
# PyCharm
96+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
97+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
98+
# and can be added to the global gitignore or merged into this file. For a more nuclear
99+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
100+
.idea/
101+
102+
### Python Patch ###
103+
104+
# ruff
105+
.ruff_cache/
106+
107+
# LSP config files
108+
pyrightconfig.json
109+
110+
# End of https://www.toptal.com/developers/gitignore/api/python
111+
# Created by https://www.toptal.com/developers/gitignore/api/vim
112+
# Edit at https://www.toptal.com/developers/gitignore?templates=vim
113+
114+
### Vim ###
115+
# Swap
116+
[._]*.s[a-v][a-z]
117+
!*.svg # comment out if you don't need vector files
118+
[._]*.sw[a-p]
119+
[._]s[a-rt-v][a-z]
120+
[._]ss[a-gi-z]
121+
[._]sw[a-p]
122+
123+
# Session
124+
Session.vim
125+
Sessionx.vim
126+
127+
# Temporary
128+
.netrwhist
129+
*~
130+
# Auto-generated tag files
131+
tags
132+
# Persistent undo
133+
[._]*.un~
134+
135+
# End of https://www.toptal.com/developers/gitignore/api/vim
136+
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode
137+
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode
138+
139+
### VisualStudioCode ###
140+
.vscode/
141+
# !.vscode/settings.json
142+
# !.vscode/tasks.json
143+
# !.vscode/launch.json
144+
# !.vscode/extensions.json
145+
# !.vscode/*.code-snippets
146+
147+
# Local History for Visual Studio Code
148+
.history/
149+
150+
# Built Visual Studio Code Extensions
151+
*.vsix
152+
153+
### VisualStudioCode Patch ###
154+
# Ignore all local history of files
155+
.history
156+
.ionide
157+
158+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
159+
# Created by https://www.toptal.com/developers/gitignore/api/jetbrains
160+
# Edit at https://www.toptal.com/developers/gitignore?templates=jetbrains
161+
162+
### JetBrains ###
163+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
164+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
165+
166+
# User-specific stuff
167+
.idea/**/workspace.xml
168+
.idea/**/tasks.xml
169+
.idea/**/usage.statistics.xml
170+
.idea/**/dictionaries
171+
.idea/**/shelf
172+
173+
# AWS User-specific
174+
.idea/**/aws.xml
175+
176+
# Generated files
177+
.idea/**/contentModel.xml
178+
179+
# Sensitive or high-churn files
180+
.idea/**/dataSources/
181+
.idea/**/dataSources.ids
182+
.idea/**/dataSources.local.xml
183+
.idea/**/sqlDataSources.xml
184+
.idea/**/dynamic.xml
185+
.idea/**/uiDesigner.xml
186+
.idea/**/dbnavigator.xml
187+
188+
# Gradle
189+
.idea/**/gradle.xml
190+
.idea/**/libraries
191+
192+
# Gradle and Maven with auto-import
193+
# When using Gradle or Maven with auto-import, you should exclude module files,
194+
# since they will be recreated, and may cause churn. Uncomment if using
195+
# auto-import.
196+
# .idea/artifacts
197+
# .idea/compiler.xml
198+
# .idea/jarRepositories.xml
199+
# .idea/modules.xml
200+
# .idea/*.iml
201+
# .idea/modules
202+
# *.iml
203+
# *.ipr
204+
205+
# CMake
206+
cmake-build-*/
207+
208+
# Mongo Explorer plugin
209+
.idea/**/mongoSettings.xml
210+
211+
# File-based project format
212+
*.iws
213+
214+
# IntelliJ
215+
out/
216+
217+
# mpeltonen/sbt-idea plugin
218+
.idea_modules/
219+
220+
# JIRA plugin
221+
atlassian-ide-plugin.xml
222+
223+
# Cursive Clojure plugin
224+
.idea/replstate.xml
225+
226+
# SonarLint plugin
227+
.idea/sonarlint/
228+
229+
# Crashlytics plugin (for Android Studio and IntelliJ)
230+
com_crashlytics_export_strings.xml
231+
crashlytics.properties
232+
crashlytics-build.properties
233+
fabric.properties
234+
235+
# Editor-based Rest Client
236+
.idea/httpRequests
237+
238+
# Android studio 3.1+ serialized cache file
239+
.idea/caches/build_file_checksums.ser
240+
241+
### JetBrains Patch ###
242+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
243+
244+
# *.iml
245+
# modules.xml
246+
# .idea/misc.xml
247+
# *.ipr
248+
249+
# Sonarlint plugin
250+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
251+
.idea/**/sonarlint/
252+
253+
# SonarQube Plugin
254+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
255+
.idea/**/sonarIssues.xml
256+
257+
# Markdown Navigator plugin
258+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
259+
.idea/**/markdown-navigator.xml
260+
.idea/**/markdown-navigator-enh.xml
261+
.idea/**/markdown-navigator/
262+
263+
# Cache file creation bug
264+
# See https://youtrack.jetbrains.com/issue/JBR-2257
265+
.idea/$CACHE_FILE$
266+
267+
# CodeStream plugin
268+
# https://plugins.jetbrains.com/plugin/12206-codestream
269+
.idea/codestream.xml
270+
271+
# Azure Toolkit for IntelliJ plugin
272+
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
273+
.idea/**/azureSettings.xml
274+
275+
# End of https://www.toptal.com/developers/gitignore/api/jetbrains

0 commit comments

Comments
 (0)