Skip to content

jmanuel1/concat

Repository files navigation

Concat

Coverage Status

An experimental concatenative Python-based programming language.

Examples are in the examples directory. To see the (out of date and incomplete) spec, go to http://jmanuel1.github.io/concat-spec/.

Python 3.7 required.

Development

Code formatting

Python code is formatted using Axblack through a pre-commit Git hook. To set this up in your clone of the repository, install the dev dependencies of the project (by running pip install -e .[dev], for example), and then run:

pre-commit install

Now Axblack and pre-commit should be working! Whenever you commit a Python file, Axblack will be ran on that file. If Axblack makes formatting changes, you might need to try restaging and recommiting.

Testing

If you run the tests on Windows, you might need a Rust installation for one of the tests. (The tests depend on pywinpty to use Windows pseudoterminals.)

If your Python is 32-bit, you may get Rust compile errors that make it look like the standard library is missing (in particular, E0463: rustc --explain E0463). As suggested by rustc, you can try adding the right standard library with rustup target add <target>. I used the target i686-pc-windows-msvc even though pywinpty claims to require x86_64-pc-windows-msvc to build from source. Then set the environment variable CARGO_BUILD_TARGET to i686-pc-windows-msvc and try to install pywinpty again.

Run the tests and get coverage info using tox run. (Make sure you've installed the development dependencies first.)

Nota Bene: If you have concat installed globally, make sure to create and enter a virtualenv before testing, so you don't end up running the installed version.

Building and uploading (on Windows)

Change the version number in setup.py. Upload will fail if you try to push an existing version.

Delete the dist directory, if it exists.

rmdir dist /S

Build source and pure Python-3 distributions.

py -3 setup.py sdist
py -3 setup.py bdist_wheel

Upload.

twine upload dist/* [-r pypitest]

Related work

For a similar idea that is more mature, check out Nustack.