Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dougransom/unimacro
Browse files Browse the repository at this point in the history
  • Loading branch information
quintijn committed Aug 8, 2024
2 parents 756ea88 + a1a5c81 commit 5803c3d
Show file tree
Hide file tree
Showing 118 changed files with 4,035 additions and 5,683 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
/src/unimacro/grammar.bin
README.html
/src/unimacro/UnimacroGrammars/rememberdialog.py
/tests/rememberdialog.py
2 changes: 0 additions & 2 deletions Packaging Python Projects — Python Packaging User Guide.url

This file was deleted.

28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,13 @@ Unimacro is reasonably stable, but still in alpha. Check the [Unimacro Issues](
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`.

## 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`



# Location of Grammars
Expand All @@ -37,17 +28,14 @@ More about [Unimacro Grammars](https://qh.antenna.nl/unimacro/grammars/globalgra

# 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:
If you want to install your local unimacro development environment as the working unimacro:
`pip install -e . `.

- 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/)
`py -m build` to build the Python package locally.


Publishing to PyPi is done through the [trusted publisher mechanism](https://docs.pypi.org/trusted-publishers/using-a-publisher/) when a release is created on github using github actions.

BEFORE YOU PUBLISH review the version number of dependencies in pyproject.toml, see if you require newer ones.



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.

71 changes: 0 additions & 71 deletions building_and_publishing_packages.txt

This file was deleted.

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.

76 changes: 60 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,70 @@
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=["dtactions",
"debugpy >= 1.2.0",
"pywin32 >= 300"]



dependencies = ["dtactions >= 1.5.7",
"debugpy >= 1.2.0",
"pywin32 >= 304",
"natlinkcore >= 5.3.7",
"pysimplegui"]

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-toolbox,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",
"src/unimacro/unimacro_test"
]
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"
File renamed without changes.
Loading

0 comments on commit 5803c3d

Please sign in to comment.