Skip to content

Commit 0a13fd7

Browse files
committed
Raises min python version, renames default branch
- Sets the minimum python version to 3.10 - Makes main the default branch
1 parent e08f978 commit 0a13fd7

49 files changed

Lines changed: 483 additions & 629 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/init/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Init
2+
description: Sets up the environment for build, lint, and test jobs
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: actions/setup-python@v4
8+
with:
9+
cache: pip
10+
cache-dependency-path: |
11+
pyproject.toml
12+
requirements.txt
13+
requirements-dev.txt
14+
15+
- name: Installing dependencies
16+
shell: sh
17+
run: >-
18+
pip install -U pip &&
19+
pip install -U -r requirements.txt -r requirements-dev.txt

.github/actions/lint/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint
2+
description: Lints the codebase with black, isort, pyflakes, and mypy
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: ./.github/actions/init
8+
9+
- name: Linting with black
10+
run: black --check mnamer tests
11+
shell: sh
12+
13+
- name: Linting isort
14+
run: isort --check-only mnamer tests
15+
shell: sh
16+
17+
- name: Linting pyflakes
18+
run: pyflakes mnamer tests
19+
shell: sh
20+
21+
- name: Linting mypy
22+
run: mypy mnamer tests
23+
shell: sh

.github/actions/test/action.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test
2+
description: Tests the codebase with pytest
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: ./.github/actions/init
8+
9+
- name: Running Local Unit Tests
10+
run: >-
11+
python -m pytest
12+
-m local
13+
--durations=10
14+
--cov=./
15+
--cov-append
16+
--cov-report=term-missing
17+
--cov-report=xml
18+
shell: sh
19+
20+
- name: Running Network Unit Tests
21+
run: >-
22+
python -m pytest
23+
-m network
24+
--reruns 3
25+
--durations=10
26+
--cov=./
27+
--cov-append
28+
--cov-report=term-missing
29+
--cov-report=xml
30+
shell: sh
31+
32+
- name: Running End to End Tests
33+
run: >-
34+
python -m pytest
35+
-m e2e
36+
--reruns 3
37+
--durations=10
38+
--cov=./
39+
--cov-append
40+
--cov-report=term-missing
41+
--cov-report=xml
42+
shell: sh
43+
44+
- name: Reporting Coverage Statistics
45+
uses: codecov/codecov-action@v1
46+
if: success() && github.ref == 'refs/heads/main'

.github/workflows/pull_request.yml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,16 @@ name: pr
33
on: pull_request
44

55
jobs:
6-
7-
lint: # ------------------------------------------------------------------------------
6+
lint:
87
runs-on: ubuntu-latest
98

109
steps:
11-
- name: Checking out Git Commit
12-
uses: actions/checkout@v2
13-
14-
- name: Installing Python 3
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: 3.x
18-
cache: pip
19-
cache-dependency-path: pyproject.toml
20-
21-
- name: Installing Linters from PyPI
22-
run: pip install .[test,dev]
23-
24-
- name: Linting with black
25-
run: black --check mnamer tests
10+
- uses: actions/checkout@v3
11+
- uses: ./.github/actions/lint
2612

27-
- name: Linting isort
28-
run: isort --check-only mnamer tests
29-
30-
- name: Linting mypy
31-
run: mypy mnamer
32-
33-
test: # ------------------------------------------------------------------------------
13+
test:
3414
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@v2
37-
- uses: actions/setup-python@v2
38-
with:
39-
python-version: 3.x
40-
cache: pip
41-
cache-dependency-path: pyproject.toml
4215

43-
- run: pip install -q -U pip .[test]
44-
- run: >-
45-
python -m pytest -m 'not tvdb'
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: ./.github/actions/test

.github/workflows/push.yml

Lines changed: 19 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -3,154 +3,45 @@ name: push
33
on:
44
push:
55
schedule:
6-
- cron: "0 8 * * 1" # Mondays at 8am
6+
- cron: "0 8 * * 1" # mondays at 8am
77

88
jobs:
9-
build: # -----------------------------------------------------------------------------
9+
lint:
1010
runs-on: ubuntu-latest
1111

12-
strategy:
13-
matrix:
14-
python-version: ["3.8", "3.x"]
15-
name: build-v${{matrix.python-version}}
16-
1712
steps:
18-
- name: Checking out Git Commit
19-
uses: actions/checkout@v2
20-
21-
- name: Installing Python
22-
uses: actions/setup-python@v2
23-
with:
24-
python-version: ${{matrix.python-version}}
25-
cache: pip
26-
cache-dependency-path: pyproject.toml
27-
28-
- uses: actions/cache@v2
29-
with:
30-
path: ${{ env.pythonLocation }}
31-
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('MANIFEST.in') }}-${{ hashFiles('pyproject.toml') }}
13+
- uses: actions/checkout@v3
14+
- uses: ./.github/actions/lint
3215

33-
- name: Installing dependencies
34-
run: pip install -U -r requirements.txt -r requirements-test.txt -r requirements-dev.txt
35-
36-
- name: Attempting build
37-
run: python -m build --wheel --no-isolation
38-
39-
lint: # ------------------------------------------------------------------------------
16+
test:
4017
runs-on: ubuntu-latest
41-
needs: build
4218

4319
steps:
44-
- name: Checking out Git Commit
45-
uses: actions/checkout@v2
46-
47-
- name: Installing Python
48-
uses: actions/setup-python@v2
49-
with:
50-
python-version: 3.x
51-
cache: pip
52-
cache-dependency-path: pyproject.toml
20+
- uses: actions/checkout@v3
21+
- uses: ./.github/actions/test
5322

54-
- uses: actions/cache@v2
55-
with:
56-
path: ${{ env.pythonLocation }}
57-
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-text.txt') }}-${{ hashFiles('MANIFEST.in') }}
58-
59-
- name: Linting with black
60-
run: black --check mnamer tests
61-
62-
- name: Linting isort
63-
run: isort --check-only mnamer tests
64-
65-
- name: Linting mypy
66-
run: mypy mnamer
67-
68-
test: # ------------------------------------------------------------------------------
23+
publish:
6924
runs-on: ubuntu-latest
70-
needs: build
71-
72-
strategy:
73-
matrix:
74-
python-version: ["8", "3.x"]
75-
name: test-v${{matrix.python-version}}
7625

77-
steps:
78-
- name: Checking out Git Commit
79-
uses: actions/checkout@v2
80-
81-
- name: Installing Python
82-
uses: actions/setup-python@v2
83-
with:
84-
python-version: ${{matrix.python-version}}
85-
cache: pip
86-
cache-dependency-path: pyproject.toml
87-
88-
- uses: actions/cache@v2
89-
with:
90-
path: ${{ env.pythonLocation }}
91-
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-text.txt') }}-${{ hashFiles('MANIFEST.in') }}
92-
- name: Running Local Unit Tests
93-
run: >-
94-
python -m pytest
95-
-m local
96-
--durations=10
97-
--cov=./
98-
--cov-append
99-
--cov-report=term-missing
100-
--cov-report=xml
101-
102-
- name: Running Network Unit Tests
103-
run: >-
104-
python -m pytest
105-
-m network
106-
--reruns 3
107-
--durations=10
108-
--cov=./
109-
--cov-append
110-
--cov-report=term-missing
111-
--cov-report=xml
26+
if: >-
27+
success()
28+
&& github.event_name == 'push'
29+
&& github.ref == 'refs/heads/main'
11230
113-
- name: Running End to End Tests
114-
run: >-
115-
python -m pytest
116-
-m e2e
117-
--reruns 3
118-
--durations=10
119-
--cov=./
120-
--cov-append
121-
--cov-report=term-missing
122-
--cov-report=xml
123-
124-
- name: Reporting Coverage Statistics
125-
if: >
126-
success()
127-
&& github.event_name == 'push'
128-
&& github.ref == 'refs/heads/master'
129-
&& matrix['python-version'] == '3.x'
130-
uses: codecov/codecov-action@v1
131-
132-
publish: # ---------------------------------------------------------------------------
133-
runs-on: ubuntu-latest
134-
if: startsWith(github.ref, 'refs/tags')
13531
needs:
136-
- build
13732
- lint
13833
- test
13934

14035
steps:
141-
- name: Checking out Git Commit
142-
uses: actions/checkout@v2
143-
144-
- name: Installing Python
145-
uses: actions/setup-python@v2
146-
with:
147-
python-version: 3.8
36+
- uses: actions/checkout@v3
37+
with: { fetch-depth: 0 } # required for setuptools_scm to detect git tags
38+
- uses: ./.github/actions/init
14839

149-
- name: Installing Requirements
150-
run: pip install -U -r requirements.txt -r -r requirements-dev.txt
40+
- name: Building
41+
run: python3 -m build --sdist --wheel --no-isolation
15142

152-
- name: Building wheel and source distribution
153-
run: python -m build --sdist --wheel
43+
- name: Reporting Version
44+
run: python3 -m mnamer --version
15445

15546
- name: Uploading to PyPI
15647
run: >-

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ __pycache__/
66
.idea
77
.mypy_cache/
88
.pytest_cache/
9-
.python-version
109
.vimrc
1110
.vs
1211
.vscode
@@ -20,6 +19,7 @@ coverage.xml
2019
demo/
2120
dist/
2221
MANIFEST
22+
mnamer/__version__.py
2323
playground.py
2424
testing/test_files_*
25-
venv*
25+
venv*

.python-version

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

.vscode/settings.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
"**/.DS_Store": true,
1515
"**/.git": true,
1616
"**/.pytest_cache/": true,
17-
"**/.svn": true,
1817
"**/__pycache__": true,
1918
"*.egg-info": true,
20-
"*.egg-info/": true,
2119
".idea": true,
2220
"demo": true,
2321
"venv": true
2422
},
25-
"python.formatting.provider": "black"
26-
}
23+
"python.formatting.provider": "black",
24+
"python.linting.mypyEnabled": true
25+
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM python:alpine
2-
ARG MNAMER_VERSION=2.4.2
2+
ARG MNAMER_VERSION=2.5.2
33
ARG UID=1000
44
ARG GID=1000
55
RUN addgroup mnamer -g $GID

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[![PyPI](https://img.shields.io/pypi/v/mnamer.svg?style=for-the-badge)](https://pypi.python.org/pypi/mnamer)
2-
[![Tests](https://img.shields.io/github/workflow/status/jkwill87/mnamer/push?style=for-the-badge&label=Tests)](https://github.com/jkwill87/mnamer/actions?query=workflow:push)
3-
[![Coverage](https://img.shields.io/codecov/c/github/jkwill87/mnamer/master.svg?style=for-the-badge)](https://codecov.io/gh/jkwill87/mnamer)
2+
[![Tests](https://img.shields.io/github/workflow/status/jkwill87/mnamer/push?style=for-the-badge&label=Tests)](https://img.shields.io/github/actions/workflow/status/jkwill87/mnamer/.github/workflows/push.yml?branch=main)
3+
[![Coverage](https://img.shields.io/codecov/c/github/jkwill87/mnamer/main.svg?style=for-the-badge)](https://codecov.io/gh/jkwill87/mnamer)
44
[![Licence](https://img.shields.io/github/license/jkwill87/mnamer.svg?style=for-the-badge)](https://en.wikipedia.org/wiki/MIT_License)
55
[![Style: Black](https://img.shields.io/badge/Style-Black-black.svg?style=for-the-badge)](https://github.com/ambv/black)
66

7-
<img src="https://github.com/jkwill87/mnamer/raw/master/assets/logo.png" width="450"/>
7+
<img src="https://github.com/jkwill87/mnamer/raw/main/assets/logo.png" width="450"/>
88

99
# mnamer
1010

1111
mnamer (**m**edia re**namer**) is an intelligent and highly configurable media organization utility. It parses media filenames for metadata, searches the web to fill in the blanks, and then renames and moves them.
1212

1313
Currently it has integration support with [TVDb](https://thetvdb.com) and [TvMaze](https://www.tvmaze.com) for television episodes and [TMDb](https://www.themoviedb.org/) and [OMDb](https://www.omdbapi.com) for movies.
1414

15-
<img src="https://github.com/jkwill87/mnamer/raw/master/assets/screenshot.png" width="750"/>
15+
<img src="https://github.com/jkwill87/mnamer/raw/main/assets/screenshot.png" width="750"/>
1616

1717
## Documentation
1818

0 commit comments

Comments
 (0)