Skip to content

Commit

Permalink
pyproject.toml: Add m2c entrypoint when installed as package (matt-…
Browse files Browse the repository at this point in the history
…kempster#274)

This allows downstream users of the m2c CLI to simply install it
through pip as part of their `requirements.txt`.
  • Loading branch information
abelbriggs1 authored May 19, 2024
1 parent ae05336 commit 2e7ec29
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,29 @@ git add tests/end_to_end/my-new-test
For PowerPC, the `MWCC_CC` environment variable should be set to point to a PPC cc binary (mwcceppc.exe),
and on non-Windows, `WINE` set to point to wine or equivalent ([wibo](https://github.com/decompals/wibo) also works).

### Installation with Poetry
### Installation as Python Package

You can include `m2c` as a dependency in your project with [Poetry](https://python-poetry.org/)
by adding the following to your `pyproject.toml`:

You can include `m2c` as a dependency in your project with [Poetry](https://python-poetry.org/) by adding the following to your `pyproject.toml`:
```toml
[tool.poetry.dependencies]
m2c = {git="https://github.com/matt-kempster/m2c.git"}
```

If your project does not use `pyproject.toml` for dependencies, you can add the following
to your `requirements.txt` file instead:

```
m2c @ git+https://github.com/matt-kempster/m2c.git
# To specify a specific Git ref, such as a commit, tag, or branch:
m2c @ git+https://github.com/matt-kempster/m2c.git@[YOUR REF HERE]
```

When installed as a Python package, a standalone command entrypoint is provided
which can run the CLI.

```bash
m2c [options] [-t <target>] [--context <context file>] [-f <function name>] <asmfile>...
```
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ readme = "README.md"
repository = "https://github.com/matt-kempster/m2c"
packages = [{include = "m2c"}]

[tool.poetry.scripts]
m2c = "m2c.main:main"

[tool.poetry.dependencies]
python = "^3.8"
pycparser = "^2.21"
Expand Down

0 comments on commit 2e7ec29

Please sign in to comment.