Skip to content

Commit

Permalink
Reorganization. Added makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeaz committed Oct 27, 2022
1 parent 818ab06 commit af80858
Show file tree
Hide file tree
Showing 93 changed files with 95 additions and 417 deletions.
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ maintained as a mature library. No new major features are planned, but
issues reported for bugs are still welcome. Any changes to the
software will be noted here.

Version 2022.10.27
------------------
10/27/22 Reoganization/modernization of the build process. PLY continues
to make no package-installable releases. However, you can now
use the Makefile to build artifacts installable via pip.
Use `make test` to test and `make build` to build.

Version 2022_01_02
------------------
12/12/21 PLY is no longer being developed in public. Instead
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include Makefile CONTRIBUTING.md
recursive-include example *
recursive-include tests *
recursive-include docs *
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PYTHON=python3
VENV=.venv

# Setup and install all of the required tools for building, testing,
# and deploying
setup::
rm -rf $(VENV)
$(PYTHON) -m venv $(VENV)
./$(VENV)/bin/python -m pip install pytest
./$(VENV)/bin/python -m pip install pytest-cov
./$(VENV)/bin/python -m pip install build
./$(VENV)/bin/python -m pip install twine

# Run unit tests
test::
./$(VENV)/bin/python -m pip install .
./$(VENV)/bin/python tests/testlex.py
./$(VENV)/bin/python tests/testyacc.py

# Build an artifact suitable for installing with pip
build::
./$(VENV)/bin/python -m build

# Install into the default Python
install::
$(PYTHON) -m pip install .
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,17 @@ flexibility in terms of how you decide to use it. You can use PLY to
build Abstract Syntax Trees (ASTs), simple one-pass compilers,
protocol decoders, or even a more advanced parsing framework.

## Important Notice - October 11, 2022
## Important Notice - October 27, 2022

I'm officially retiring the PLY project. There will be no further
releases. Should you choose to still use it, the GitHub repo will
remain alive--feel free to vendor the code and report bugs as you see
fit. I'd like to thank everyone who contributed to the
project over the last twenty-one years. -- Dave
The PLY project will make no further package-installable releases.
If you want the latest version, you'll need to download it here
or clone the repo.

## Download

* [Current Release (ply-2022_01_02)](https://github.com/dabeaz/ply/raw/master/ply-2022_01_02.tar.gz)
* [Historial Releases](https://github.com/dabeaz/archive/tree/main/ply)
## Requirements

The current release of PLY requires the use of Python 3.6 or
greater. If you need to support an older version, download one of the
historical releases.
historical releases at https://github.com/dabeaz/archive/tree/main/ply.

## How to Install and Use

Expand Down
Binary file removed ply-2022_01_02.tar.gz
Binary file not shown.
Binary file removed ply-tests.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
18 changes: 18 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[metadata]
name = ply
version = 2022.10.27
url = https://github.com/dabeaz/ply
author = David Beazley
author_email = "David Beazley" <[email protected]>
description = "PLY - Sly Lex Yacc"
long_description = "PLY is an implementation of lex and yacc. No longer maintained on PyPI. Latest version on GitHub."
license = MIT
license_files = LICENSE
classifiers =
License :: OSI Approved :: MIT License

[options]
package_dir =
=src

packages = ply
2 changes: 1 addition & 1 deletion ply/__init__.py → src/ply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Author: David Beazley ([email protected])
# https://github.com/dabeaz/ply

__version__ = '2022_01_02'
__version__ = '2022.10.27'
File renamed without changes.
File renamed without changes.
153 changes: 0 additions & 153 deletions test/testcpp.py

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions test/calclex.py → tests/calclex.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -----------------------------------------------------------------------------
# calclex.py
# -----------------------------------------------------------------------------
import sys

if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex

tokens = (
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions test/lex_closure.py → tests/lex_closure.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -----------------------------------------------------------------------------
# lex_closure.py
# -----------------------------------------------------------------------------
import sys

if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex

tokens = (
Expand Down
3 changes: 0 additions & 3 deletions test/lex_doc1.py → tests/lex_doc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Missing documentation string

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_dup1.py → tests/lex_dup1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Duplicated rule specifiers

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_dup2.py → tests/lex_dup2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Duplicated rule specifiers

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_dup3.py → tests/lex_dup3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Duplicated rule specifiers

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_empty.py → tests/lex_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# No rules defined

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_error1.py → tests/lex_error1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Missing t_error() rule

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_error2.py → tests/lex_error2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# t_error defined, but not function

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_error3.py → tests/lex_error3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# t_error defined as function, but with wrong # args

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_error4.py → tests/lex_error4.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# t_error defined as function, but too many args

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
2 changes: 0 additions & 2 deletions test/lex_hedit.py → tests/lex_hedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# This example shows how to modify the state of the lexer to parse
# such tokens
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

Expand Down
3 changes: 0 additions & 3 deletions test/lex_ignore.py → tests/lex_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Improperly specific ignore declaration

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
3 changes: 0 additions & 3 deletions test/lex_ignore2.py → tests/lex_ignore2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# ignore declaration as a raw string

import sys
if ".." not in sys.path: sys.path.insert(0,"..")

import ply.lex as lex

tokens = [
Expand Down
Loading

0 comments on commit af80858

Please sign in to comment.