Skip to content

Commit

Permalink
chore: update setup and modernize a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored and idank committed Sep 23, 2021
1 parent e50dcc2 commit a82fc5f
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ bashlex/parsetab.py
build/
dist/
bashlex.egg-info/
*env*/
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests:
@python -c "import nose" >/dev/null 2>&1 || (echo "error: nose missing, run 'pip install nose'\n" && false)
python -m nose --with-doctest
@python -c "import pytest" >/dev/null 2>&1 || (echo "error: pytest missing, run 'pip install pytest'\n" && false)
python -m pytest

.PHONY: tests
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,18 @@ process/command substitutions.

## Releasing a new version

- make tests
- bump version in setup.py
Suggestion for making a release environment:

```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

- `make tests`
- bump version in `setup.py`
- git tag the new commit
- run`python setup.py bdist_egg sdist
- run `python -m build`
- run twine upload dist/*

## License
Expand Down
4 changes: 3 additions & 1 deletion examples/commandsubstitution-remover.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import print_function

import sys

import argparse
Expand Down Expand Up @@ -72,4 +74,4 @@ def visitcommandsubstitution(self, n, command):
# with the replacement string
postprocessed[start:end] = args.replacement

print ''.join(postprocessed)
print(''.join(postprocessed))
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]

build-backend = "setuptools.build_meta"
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
enum34
enum34; python_version < "3.4"
build
twine
pytest
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[bdist_wheel]
universal=1

[tool:pytest]
addopts = --doctest-modules -ra
13 changes: 3 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
try:
from setuptools import setup #Py2
except ImportError:
from distutils.core import setup #Py3
from setuptools import setup

import sys

install_requires = []
if sys.version_info < (3, 4):
install_requires.append('enum34')

setup(
name='bashlex',
Expand Down Expand Up @@ -37,6 +29,7 @@
'Topic :: System :: System Shells',
'Topic :: Text Processing',
],
install_requires=install_requires,
python_requires=">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, !=3.4",
install_requires=['enum34; python_version < "3.4"'],
packages=['bashlex'],
)

0 comments on commit a82fc5f

Please sign in to comment.