Skip to content

Commit

Permalink
Merge branch 'v2'
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfx committed Feb 20, 2024
2 parents 7bf1f92 + 01b849c commit 424a24a
Show file tree
Hide file tree
Showing 17 changed files with 501 additions and 506 deletions.
58 changes: 15 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
python: [3.7, 3.9]
python: ['3.7', '3.10']
os: [ubuntu-22.04, windows-latest]
include:
- os: ubuntu-22.04
path: ~/.cache/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand All @@ -59,59 +59,31 @@ jobs:
- name: Fuzz tests
run: |
python ./test/test_fuzz.py
test_py27:
name: Test python-2.7
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
mypy:
name: mypy type check
runs-on: ubuntu-22.04
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- uses: actions/cache@v2
- uses: actions/checkout@v4
- name: Run mypy
uses: jpetrucciani/mypy-check@master
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pylint
- name: Install
run: |
python setup.py install
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./src --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Py3 syntax
run: |
# check py3 syntax
python -m pylint -E --py3k -r n ./src
- name: Unittests
run: |
python -m pytest ./test/test_unit.py
- name: Fuzz tests
run: |
python ./test/test_fuzz.py
path: './src/fileseq'

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
needs:
- test
- test_py27
- mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
.venv/
build/
develop-eggs/
dist/
Expand All @@ -22,6 +23,7 @@ out/
*.egg-info/
.installed.cfg
*.egg
.DS_Store

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -62,3 +64,5 @@ atlassian-ide-plugin.xml
# Line Profiler Logs
*.py.prof
*.py.lprof

.dmypy.json
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
graft test
include README.md
global-include *.exr *.ext *.jpg *.py
prune .venv/
prune docs/
prune test/.pytest_cache/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A FrameSet wraps a sequence of frames in a list container.
```python
fs = fileseq.FrameSet("1-5")
for f in fs:
print f
print(f)
```

### Access Frames
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3.7/', None),
'python': ('https://docs.python.org/3.10/', None),
}

# Add python types to exclude from sphinx check that complains about
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# python 2/3 support
future
typing-extensions

# testing
pytest
Expand Down
24 changes: 13 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
#!/usr/bin/env python

from __future__ import absolute_import
import os
from setuptools import setup, find_packages
from codecs import open

here = os.path.abspath(os.path.dirname(__file__))

__version__ = 'dev'
with open(os.path.join(here, "src/fileseq/__version__.py")) as version_file:
exec(version_file.read())

# Get the long description from the README file
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

descript = 'A Python library for parsing frame ranges and file sequences ' \
'commonly used in VFX and Animation applications.'

setup(name='Fileseq',
version=__version__,

package_dir = {'': 'src'},
package_dir={'': 'src'},
packages=find_packages('src'),
package_data={'fileseq': ['py.typed']},

test_suite="test.run",

Expand All @@ -40,16 +41,17 @@
license='MIT',

classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3',
],

keywords='vfx visual effects file sequence frames image',

install_requires=['future'],
install_requires=['typing-extensions'],
)
9 changes: 4 additions & 5 deletions src/fileseq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,11 @@
fileseq.findSequenceOnDisk('/foo/bar.#.#.exr', allow_subframes=True)
"""
from __future__ import absolute_import

from fileseq.constants import PAD_STYLE_DEFAULT, PAD_STYLE_HASH1, PAD_STYLE_HASH4
from fileseq.exceptions import ParseException, MaxSizeException, FileSeqException
from fileseq.frameset import FrameSet
from fileseq.filesequence import FileSequence
from .constants import PAD_STYLE_DEFAULT, PAD_STYLE_HASH1, PAD_STYLE_HASH4
from .exceptions import ParseException, MaxSizeException, FileSeqException
from .frameset import FrameSet
from .filesequence import FileSequence

padFrameRange = FrameSet.padFrameRange
framesToFrameRange = FrameSet.framesToFrameRange
Expand Down
2 changes: 1 addition & 1 deletion src/fileseq/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.15.2'
__version__ = '2.0.0'
7 changes: 3 additions & 4 deletions src/fileseq/constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#! /usr/bin/env python
"""
constants - General constants of use to fileseq operations.
"""
from __future__ import absolute_import

import re

Expand All @@ -12,7 +10,7 @@


class _PadStyle(object):
def __init__(self, name):
def __init__(self, name: str):
self.__name = name

def __hash__(self):
Expand Down Expand Up @@ -98,7 +96,8 @@ def __eq__(self, other):
)?
)?
)
""",r"""
""",
r"""
(?:
-?\d+\.\d+ # start frame
(?: # optional range
Expand Down
1 change: 0 additions & 1 deletion src/fileseq/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#! /usr/bin/env python
"""
exceptions - Exception subclasses relevant to fileseq operations.
"""
Expand Down
Loading

0 comments on commit 424a24a

Please sign in to comment.