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

wip #35

Closed
wants to merge 19 commits into from
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# at some point there will be support for pdm
# see https://github.com/direnv/direnv/pull/1019
layout python
41 changes: 41 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install -e .[docs]
sphinx-build -b html docs/ docs/_build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install enzyme
run: |
python -m pip install -U pip
python -m pip install -e ".[test]"
- name: Test
run: pytest
28 changes: 28 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
87 changes: 60 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,71 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
lib
lib64
__pycache__
*.egg
MANIFEST

# Tests
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Installer logs
pip-log.txt
# Sphinx documentation
docs/_build/

# PyDev
.project
.pydevproject
.settings
# pdm
.pdm.toml
.pdm-python
.pdm-build/

# Visual Studio Code
.vscode/
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Sphinx
docs/_build
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.direnv/

# Enzyme test folders
enzyme/tests/test_*/
# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Enzyme
tests/data/
34 changes: 0 additions & 34 deletions HISTORY.rst

This file was deleted.

29 changes: 19 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
Copyright 2013 Antoine Bertin
MIT License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Copyright (c) 2021 Antoine Bertin

http://www.apache.org/licenses/LICENSE-2.0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Enzyme

Enzyme is a Python module to parse video metadata.

## Usage

Parse a MKV file metadata:

```python
>>> import enzyme
>>> with open('example.mkv', 'rb') as f:
... mkv = enzyme.MKV(f)
...
>>> mkv.info
<Info [title=None, duration=0:00:01.440000, date=2015-03-14 08:40:16]>
>>> mkv.video_tracks
[<VideoTrack [2, 720x576, V_DIRAC, name=u'Video\x00', language=None]>]
>>> mkv.audio_tracks
[<AudioTrack [1, 2 channel(s), 44100Hz, A_MS/ACM, name=u'Audio\x00', language=None]>]
```

## License

Enzyme is licensed under the MIT license.
41 changes: 0 additions & 41 deletions README.rst

This file was deleted.

Loading