Skip to content

Commit

Permalink
Vendor in ply as needed
Browse files Browse the repository at this point in the history
* vendored in some ply subcomponents
  - ply.lex
  - ply.yacc
* updated rest of project to reflect ply vendoring
* updated pyproject to configure black
  - retain defaults
  - skip linting on vendored ply module
  • Loading branch information
drawks committed Jan 2, 2020
1 parent 19af7f5 commit 35f9f6a
Show file tree
Hide file tree
Showing 8 changed files with 4,634 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Expand Up @@ -2,10 +2,6 @@ language: python
sudo: required
dist: xenial

env:
- PLY=ply==3.8
- PLY=ply

python:
- "2.7"
- "3.4"
Expand All @@ -15,7 +11,6 @@ python:

# command to install dependencies
install:
- "pip install $PLY"
- "pip install ."
- "pip install -r testing-requirements.txt"
- "pip list"
Expand Down
24 changes: 23 additions & 1 deletion pyproject.toml
@@ -1,3 +1,25 @@
[build-system]
requires = ["setuptools", "wheel", "ply"]
requires = ["setuptools", "wheel"]

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.nox
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
| /src/hcl/ply # exclude vendored ply module
)
'''
1 change: 0 additions & 1 deletion requirements.txt
@@ -1 +0,0 @@
ply>=3.8,<4
3 changes: 2 additions & 1 deletion src/hcl/lexer.py
@@ -1,6 +1,7 @@
import re
import sys
import ply.lex as lex

from .ply import lex

if sys.version_info < (3,):
text_type = unicode
Expand Down
2 changes: 1 addition & 1 deletion src/hcl/parser.py
Expand Up @@ -2,7 +2,7 @@
import sys

from .lexer import Lexer
from ply import lex, yacc
from .ply import yacc

import inspect

Expand Down
5 changes: 5 additions & 0 deletions src/hcl/ply/__init__.py
@@ -0,0 +1,5 @@
# PLY package
# Author: David Beazley (dave@dabeaz.com)

__version__ = '3.11'
__all__ = ['lex','yacc']

0 comments on commit 35f9f6a

Please sign in to comment.