Skip to content

Commit

Permalink
Merge bf0554c into 8444b53
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Feb 12, 2020
2 parents 8444b53 + bf0554c commit ba84b7c
Show file tree
Hide file tree
Showing 75 changed files with 91 additions and 2,076 deletions.
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"

before_install:
# Installing Arpeggio as a dependency
# Installing Arpeggio and textX-dev as a dependency
- cd ..
- git clone --depth=1 --branch=master git://github.com/textX/Arpeggio.git
- cd Arpeggio && python setup.py install
- cd ../textX
- pip install -e Arpeggio
# Dev dependencies are still needed for testing. Should be removed.
- git clone --depth=1 --branch=master git://github.com/textX/textx-lang-questionnaire.git
- pip install -e textx-lang-questionnaire
- git clone --depth=1 --branch=master git://github.com/textX/textx-gen-que-txproject.git
- pip install -e textx-gen-que-txproject
- git clone --depth=1 --branch=master git://github.com/textX/textX-dev.git
- pip install -e textX-dev
- cd textX

install:
- ./install-all-dev.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ MIT

## Python versions

Tested for 2.7, 3.4+
Tested for 3.6+


[Arpeggio]: https://github.com/textX/Arpeggio
Expand Down
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ To install development (`master` branch) version:

## Python versions

textX works with Python 2.7, 3.4+. Other versions might work but are not
tested.
textX works with Python 3.6+. Other versions might work but are not tested.

## Getting started

Expand Down
8 changes: 4 additions & 4 deletions docs/visualization.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Visualization

A meta-model, model and parse-tree can be exported to dot files ([GraphViz]) for
visualization. Module `textx.export` contains functions `metamodel_export` and
visualization. Module `textxdev.export` contains functions `metamodel_export` and
`model_export` that can export meta-model and model to dot files respectively.
But, it is usually more convenient to produce visualization using the [`textx`
command](textx_command.md).
Expand Down Expand Up @@ -152,7 +152,7 @@ example](https://github.com/textX/textX/tree/master/examples/Entity)):

```python
from textx import metamodel_from_file
from textx.export import metamodel_export
from textxdev.export import metamodel_export

entity_mm = metamodel_from_file('entity.tx')

Expand All @@ -175,7 +175,7 @@ model for the [PlantUML] tool.

```python
from textx import metamodel_from_file
from textx.export import metamodel_export, PlantUmlRenderer
from textxdev.export import metamodel_export, PlantUmlRenderer

entity_mm = metamodel_from_file('entity.tx')

Expand All @@ -200,7 +200,7 @@ Similarly to meta-model visualization, you can also visualize your models (see [
example](https://github.com/textX/textX/tree/master/examples/Entity)).

```python
from textx.export import model_export
from textxdev.export import model_export

person_model = entity_mm.model_from_file('person.ent')

Expand Down
2 changes: 1 addition & 1 deletion examples/Entity/entity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from os.path import dirname, join
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export


this_folder = dirname(__file__)
Expand Down
2 changes: 1 addition & 1 deletion examples/expression/boolean.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
from os.path import join, dirname
from textx import metamodel_from_str
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export

grammar = '''
Bool: assignments*=Assignment expression=Or;
Expand Down
2 changes: 1 addition & 1 deletion examples/expression/calc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
from os.path import join, dirname
from textx import metamodel_from_str
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export

grammar = '''
Calc: assignments*=Assignment expression=Expression;
Expand Down
2 changes: 1 addition & 1 deletion examples/expression/calc_isinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from os.path import join, dirname
from textx import metamodel_from_str
from textx import textx_isinstance
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export

if sys.version < '3':
text = unicode # noqa
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/hello.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from os.path import join, dirname
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export


def main(debug=False):
Expand Down
2 changes: 1 addition & 1 deletion examples/json/json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os.path import join, dirname
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export


def main(debug=False):
Expand Down
2 changes: 1 addition & 1 deletion examples/pyFlies/experiment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os.path import join, dirname
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export


def main(debug=False):
Expand Down
2 changes: 1 addition & 1 deletion examples/render_all_grammars/render_all_grammars.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import unicode_literals
from textx import metamodel_from_file
from textx.export import metamodel_export, PlantUmlRenderer
from textxdev.export import metamodel_export, PlantUmlRenderer
import fnmatch
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion examples/robot/robot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os.path import join, dirname
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export


def move_command_processor(move_cmd):
Expand Down
2 changes: 1 addition & 1 deletion examples/workflow/workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os.path import join, dirname
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from textxdev.export import metamodel_export, model_export


def main(debug=False):
Expand Down
11 changes: 1 addition & 10 deletions install-all-dev.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
#!/bin/sh

pip install --upgrade pip || exit 1
pip install python-coveralls
pip install Jinja2
pip install coverage
pip install flake8
pip install -e . || exit 1
pip install -e tests/functional/subcommands/example_project || exit 1
pip install -e tests/functional/registration/projects/types_dsl || exit 1
pip install -e tests/functional/registration/projects/data_dsl || exit 1
pip install -e tests/functional/registration/projects/flow_dsl || exit 1
pip install -e tests/functional/registration/projects/flow_codegen || exit 1
pip install -e .[dev,test] || exit 1
6 changes: 0 additions & 6 deletions requirements_dev.txt

This file was deleted.

52 changes: 52 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,58 @@
[metadata]
name = textX
author = Igor R. Dejanovic
author_email = igor.dejanovic@gmail.com
license = MIT
description = Meta-language for DSL implementation inspired by Xtext
keywords = parser, meta-language, meta-model, language, DSL
url = https://github.com/textX/textX
long_description = file: README
long_description_content_type = text/markdown
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: Science/Research
Topic :: Software Development :: Interpreters
Topic :: Software Development :: Compilers
Topic :: Software Development :: Libraries :: Python Modules
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
description-file = README.md

[options]
packages = textx, textx.scoping
zip_safe = False
install_requires = Arpeggio>=1.9.0
include_package_data = True
package_dir =
textx = textx
setup_requires =
setuptools_scm
wheel

[options.extras_require]
dev =
textx-dev
mkdocs
mike
test =
textx-dev
flake8
tox
jinja2
coverage
coveralls
pytest

[options.entry_points]
textx_languages =
textx = textx.metamodel:textx

[bdist_wheel]
universal=1

Expand Down
82 changes: 6 additions & 76 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@
# -*- coding: utf-8 -*-
import os
import sys
import codecs
from setuptools import setup

VERSIONFILE = "textx/__init__.py"
VERSION = None
for line in open(VERSIONFILE, "r").readlines():
if line.startswith('__version__'):
VERSION = line.split('"')[1]

if not VERSION:
raise RuntimeError('No version defined in textx.__init__.py')

README = codecs.open(os.path.join(os.path.dirname(__file__), 'README.md'),
'r', encoding='utf-8').read()

from pathlib import Path
this_dir = Path(__file__).absolute().parent

if sys.argv[-1].startswith('publish'):
if os.system("pip list | grep wheel"):
Expand All @@ -30,67 +18,9 @@
os.system("twine upload -r test dist/*")
else:
os.system("twine upload dist/*")
print("You probably want to also tag the version now:")
print(" git tag -a {0} -m 'version {0}'".format(VERSION))
print(" git push --tags")
sys.exit()

setup(
name='textX',
version=VERSION,
description='Meta-language for DSL implementation inspired by Xtext',
long_description=README,
long_description_content_type='text/markdown',
author='Igor R. Dejanovic',
author_email='igor.dejanovic@gmail.com',
license='MIT',
url='https://github.com/textX/textX',
download_url='https://github.com/textX/textX/archive/v%s.tar.gz'
% VERSION,
packages=["textx", "textx.cli", "textx.scoping"],
install_requires=["Arpeggio>=1.9.0", "click==7.0"],
tests_require=[
'pytest',
],
keywords="parser meta-language meta-model language DSL",
entry_points={
'console_scripts': [
'textx = textx.cli:textx'
],
'textx_commands': [
'version = textx.cli:version',
'list_languages = textx.cli.discover:list_languages',
'list_generators = textx.cli.discover:list_generators',
'generate = textx.cli.generate:generate',
'check = textx.cli.check:check'
],
'textx_languages': [
'textx = textx.metamodel:textx', # textX meta-language is built-in
],
'textx_generators': [
'textx_dot = textx.generators:metamodel_generate_dot',
'any_dot = textx.generators:model_generate_dot',
'textx_plantuml = textx.generators:metamodel_generate_plantuml',
]
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'Topic :: Software Development :: Interpreters',
'Topic :: Software Development :: Compilers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
]

)
setup(use_scm_version={
"write_to": str(this_dir / "textx" / "version.py"),
"write_to_template": '__version__ = "{version}"\n',
})
1 change: 0 additions & 1 deletion tests/functional/generators/example.hello

This file was deleted.

8 changes: 0 additions & 8 deletions tests/functional/generators/hello.tx

This file was deleted.

0 comments on commit ba84b7c

Please sign in to comment.