Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
naveen521kk committed Dec 22, 2020
0 parents commit db9e29e
Show file tree
Hide file tree
Showing 16 changed files with 4,074 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,tests/generate_data.py
95 changes: 95 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Build Wheels

on:
push:
pull_request:
branches:
- main
release:
types: [created]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-latest, windows-2016]
env:
CIBW_BUILD: "cp37-* cp36-* cp38-* cp39-*"
CIBW_SKIP: "pp* cp35"
CIBW_BEFORE_BUILD_LINUX: "yum install -y pkgconfig && yum install -y cairo-devel && yum install -y pango-devel && pip install ."
CIBW_BEFORE_BUILD_MACOS: "brew install pango && brew install cairo && pip install ."
CIBW_BEFORE_BUILD_WINDOWS: "pip install cython && python windll/download_dlls.py && pkg-config --libs pango"
CIBW_TEST_REQUIRES: Cython
CIBW_ENVIRONMENT_WINDOWS: "PKG_CONFIG_PATH='C:\\cibw\\vendor\\lib\\pkgconfig'"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: python windll/inject-dlls.py {wheel} {dest_dir} C:\cibw\vendor\bin
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.7"

- name: Install cibuildwheel
env:
event_name: ${{ github.event_name }}
continue-on-error: true
shell: bash
run: |
python -m pip install cibuildwheel==1.6.4
echo "$event_name"
- name: Install External Dependencies (Linux)
if: runner.os == 'Linux'
run: |
pip install setuptools wheel twine Cython setuptools
sudo apt install libcairo2-dev pkg-config python3-dev
sudo apt-get install libpango1.0-dev
- name: Install External Dependencies (MacOS)
if: runner.os == 'macOS'
run: |
brew install pango
brew install cairo
- name: Build wheels(Windows)
if: runner.os == 'windows'
run: |
$env:PATH="$env:PATH;C:\cibw\vendor\pkg-config\bin"
$env:PKG_CONFIG_PATH="C:\cibw\vendor\lib\pkgconfig"
python -m cibuildwheel --output-dir wheelhouse
- name: Build wheels (Non-Windows)
if: runner.os != 'windows'
run: |
python -m cibuildwheel --output-dir wheelhouse
7z a wheels.zip wheelhouse/*.whl
- uses: actions/upload-artifact@v2
with:
path: wheels.zip
name: wheels-${{ runner.os }}
- name: Publish (Release)
if: ${{ github.event_name== 'release' && runner.os == 'Linux' }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
python setup.py sdist
twine upload dist/*
- name: Publish (Release)
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
twine upload wheelhouse/*.whl
twine upload wheelhouse/*.whl
twine upload wheelhouse/*.whl
145 changes: 145 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Prerequisites
# Byte-compiled / optimized / DLL files
__pycache__/
docs/source/reference
docs/_build
*.py[cod]
*$py.class
*.c
# C extensions
*.so
text2svg/*.dll
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

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

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
*.c
*.cbp
*.svg
.vscode
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: fix-encoding-pragma
- id: mixed-line-ending
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.6.4
hooks:
- id: isort
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include windll/LICENSE.win32 *.md
recursive-include text2svg *.pyx *.pxd
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ManimPango

Pango binding for Manim.
12 changes: 12 additions & 0 deletions manimpango/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os

if os.name == "nt":
os.environ["PATH"] = (
os.path.abspath(os.path.dirname(__file__))
+ os.pathsep
+ os.environ["PATH"] # noqa: E501
)
try:
from .cmanimpango import * # noqa: F401,F403
except ImportError:
raise ImportError("Couldn't load the necessary Shared Libraries.")
Loading

0 comments on commit db9e29e

Please sign in to comment.