Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dictation-toolbox/unimacro CLEANI…
Browse files Browse the repository at this point in the history
…NG UP changes website unimacro
  • Loading branch information
quintijn committed Nov 20, 2024
2 parents f522031 + 707f2ac commit d1aaf05
Show file tree
Hide file tree
Showing 373 changed files with 6,200 additions and 29,944 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/python-lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python 🐛 Lint/Test

on:
push:
pull_request:

jobs:
test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
#we can't install this becuase it depends on natlink, which currently cannot be installed via pip.
#python -m pip install -e .[test]
#for now, just install dependencies required for linting sepcifically
python -m pip install flake8
- name: Linting with flake8
run: |
#stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
#exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Running pytest tests
run: |
echo "tests not implemented"
# pip install -e .[test]
# pytest
25 changes: 25 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Package 📦 to PyPI
on:
release:
types: [published] # with prerelease and release

permissions:
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
jobs:
build_and_publish:
# Set up the environment `CI` references the secret `PYPI_API_TOKEN` in repository settings
# https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#referencing-an-environment
environment: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Installing build Dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ __pycache__/
/unimacro_test/testresult.txt
/_number extended.py
/_repeat.py
.vscode
.vscode/launch.json
/dist
/configurenatlink_error.txt
/README.html
/website unimacro/html/
/src/unimacro/UnimacroGrammars/rememberdialog.py
/tests/rememberdialog.py
/src/unimacro/UnimacroGrammars/rememberdialog.py
2 changes: 0 additions & 2 deletions Packaging Python Projects — Python Packaging User Guide.url

This file was deleted.

46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,45 @@ Read more at [Natlink, including Unimacro and Vocolaa](https://qh.antenna.nl/uni
Unimacro is reasonably stable, but still in alpha. Check the [Unimacro Issues](https://github.com/dictation-toolbox/unimacro/issues) to see the problem
areas - probably nothing you can't live without.



## Install a prerelease of [Python for Win 32](https://github.com/mhammond/pywin32)
The latest the version of [Python for Win 32](https://github.com/mhammond/pywin32) in the Python Packing Index (300) has some bugs that affect Unimacro.
So you need to install a later version.

You can download can updated pywin32 from https://github.com/mhammond/pywin32/pull/1622/checks, click on Artifacts, download the artifacts, extract the files to your computer somehwhere.

In a shell with administrator privileges,
`pip install --force-reinstall .\pywin32-300.1-cp38-cp38-win32.whl`.
A limited number of grammars are by default available when you install unimacro:

_control.py
_general.py
_folders.py
_lines.py
_brackets.py
_tags.py
_tasks.py
_clickbyvoice.py
_number simple.py

## Install unimacro

Install from the [Test Python Package Index](https://test.pypi.org/)
Install from the [Python Package Index](https://pypi.org/)
with the following.

`pip install --no-cache --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple unimacro`
`pip install unimacro`

But... when you install Natlink via the natlink installer, and proceed with "Configure Natlink via GUI" or "Configure Natlink via CLI", and choose to activate Unimacro, this "pip" action is automatically performed.



# Location of Grammars

Grammars installed with Unimacro will be installed in:
The Grammars listed above are installed with Unimacro in:
the Lib\site-packages\unimacro\UnimacroGrammars sub-directory of your
Python installation. Good ones to start with include _folders.py and _clickbyvoice.py
as most users will find web and file system navigation by voice useful.
Python installation.

More about [Unimacro Grammars](https://qh.antenna.nl/unimacro/grammars/globalgrammars/folders/index.html)

# Developer instructions.

Follow the instructions for [Natlink](https://test.pypi.org/project/natlinkpy/), replacing 'natlink' with 'unimacro'.
The same commands for building packages and publishing are available in the unimacro root.

If you wish to build or publish a package, there are:

- build_package.ps1 and build_package.ps1 to build the packages.
- publish_package_pypi.ps1/.cmd to upload the package to the [Python Packaging Index](https://pypi.org/)
- publish_package_testpypi.ps1/.cmd to upload the packkage to the [Test Python Packaging Index](https://test.pypi.org/)
If you want to install your local unimacro development environment as the working unimacro:
`pip install -e .[dev,test] `.

`py -m build` to build the Python package locally.

To publish a release to [Python Packaging Index](https://pypi.org/), [draft a new release](https://github.com/dictation-toolbox/unimacro/releases).



Expand Down
2 changes: 0 additions & 2 deletions Why use Flit- — Flit 3.0.0 documentation.url

This file was deleted.

1 change: 0 additions & 1 deletion build_package.cmd

This file was deleted.

4 changes: 0 additions & 4 deletions build_package.ps1

This file was deleted.

64 changes: 0 additions & 64 deletions building_and_publishing_packages.txt

This file was deleted.

Binary file removed hallo.wav
Binary file not shown.
2 changes: 0 additions & 2 deletions packaging instructions.txt

This file was deleted.

1 change: 0 additions & 1 deletion publish_package_pypi.cmd

This file was deleted.

4 changes: 0 additions & 4 deletions publish_package_pypi.ps1

This file was deleted.

1 change: 0 additions & 1 deletion publish_package_tesetpypi.cmd

This file was deleted.

4 changes: 0 additions & 4 deletions publish_package_testpypi.ps1

This file was deleted.

75 changes: 59 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,69 @@
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.metadata]
module="unimacro"
author = "Quintijn Hoogenboom"
author-email = "q.hoogenboom@antenna.nl"
home-page = "https://qh.antenna.nl/unimacro/"
description-file = "README.md"
[project]
name = "unimacro"
authors = [{name = "Quintijn Hoogenboom (maintainer)", email = "q.hoogenboom@antenna.nl"}]
dynamic = ["version", "description"]
requires-python = ">=3.10"
readme = "README.md"

requires=["natlink",
"debugpy >= 1.2.0",
"pywin32 >= 300"]



dependencies = ["dtactions >= 1.6.2",
"debugpy >= 1.2.0",
"pywin32 >= 304",
"natlinkcore >= 5.4.1",
"FreeSimpleGUI>=5.1.0"]

classifiers=[ "Development Status :: 4 - Beta",
"Topic :: Multimedia :: Sound/Audio :: Speech",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
]
"Environment :: Win32 (MS Windows)",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Multimedia :: Sound/Audio :: Speech",
"Topic :: Software Development :: Libraries :: Python Modules",
]

requires-python = ">=3.8"
keywords="dragon,speech,dictation,dictation-toolobx,unimacro,natlink"
[project.optional-dependencies]
test = [
"pytest >=7.1.2","flake8"
]
dev = [
"pyenvutils","entry-point-inspector","build"
]
[project.entry-points."natlink.grammars"]
unimacro_builtins = "unimacro.UnimacroGrammars:locateme"

[project.entry-points."dt.loggers"]
unimacro ="unimacro:logname"
control="unimacro:control_logger_name"
folders="unimacro:folders_logger_name"

[tool.flit.scripts]
[tool.pytest.ini_options]
minversion = "7.1.2"
addopts = "--capture=tee-sys "
# very important
#the pythonpath lets pytest load code in your source area
#in addition to that in site-packages etc.
#you may want to run your tests without install natlinkcore with flit or pip
pythonpath = [
]
testpaths= [
"tests",
]
python_files = [
"unittest*.py",
"test_*.py",
]

[project.scripts]


[project.urls]
homepage = "https://qh.antenna.nl/unimacro/"
repository="https://github.com/dictation-toolbox/unimacro"
source="https://github.com/dictation-toolbox/unimacro"
Loading

0 comments on commit d1aaf05

Please sign in to comment.