Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,26 @@ jobs:
app_file_ext: "app"
asset_file_ext: "zip"
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3

- name: Activate Anaconda Environment
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environments/${{ matrix.os }}-environment.yml
python-version: 3.11
miniconda-version: latest
activate-environment: tactool
auto-activate-base: false

- name: Build Environment
run: |
conda create -n tactool python=3.13
conda activate tactool
pip install -e ".[pyinstaller]"

- name: Build with PyInstaller
shell: bash -l {0}
run: pyinstaller --name="tactool" --windowed --paths=. --onefile tactool/main.py

- name: ZIP Application
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
paths:
- '**.py'
- 'environments/*.yml'
- 'pyproject.toml'
- '.github/workflows/test.yml'

jobs:
Expand All @@ -13,22 +13,29 @@ jobs:
matrix:
os: [windows, macos]
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3

- name: Activate Anaconda Environment
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environments/${{ matrix.os }}-environment.yml
python-version: 3.11
miniconda-version: latest
activate-environment: tactool
auto-activate-base: false

- name: Build Environment
run: |
conda create -n tactool python=3.13
conda activate tactool
pip install -e ".[test]"

- name: Lint
shell: bash -l {0}
run: flake8

- name: Test
shell: bash -l {0}
run: |
export PYTHONPATH=.
pytest -vvs test/
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@ dist
.pytest_cache
_LOCAL_LEO
*.spec
*.swp
*.pyc
.tox
.ipynb_checkpoints/
*.egg-info
htmlcov
coverage.xml
.coverage*
.vscode
pip-wheel-metadata
*Thumbs.db
*.DS_Store
*.idea
.mypy_cache/
junit.xml
.vscode-server
38 changes: 11 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,28 @@ The original idea was by Connor Newstead and Matt Horstwood.

If you would like to give feedback, ask questions, submit a bug report, or make a contribution to TACtool, you are welcome to submit an issue to the repository [here](https://github.com/BritishGeologicalSurvey/tactool/issues).

### Installation
### Developer Installation

> Note: this is only if you want to run the tool from the source code. If you just want to use the app, see "[Getting started](#getting-started)" above.

Check out the repository and install dependencies using Anaconda.
Clone the repository, create a virtual environment, e.g. with `conda`, and activate it.
Then install the package with `pip` in editable mode for development with the optional
dependencies for testing.

#### Windows
```bash
conda env create -f environments/windows-environment.yml
conda activate tactool-windows
```

#### MacOS
```bash
conda env create -f environments/macos-environment.yml
conda activate tactool-macos
conda create -n tactool python=3.14
conda activate tactool
cd tactool
python3 -m pip install -e ".[test]"
```

_Note: Both environments have been generated using `environments/unversioned-environment.yml`._

### Running the Program

To run the program, first you need to setup your Python path.
To run the program, activate the environment and run the `tactool --dev` command.

#### Windows
```bash
$env:PYTHONPATH="."
```

#### MacOS
```bash
export PYTHONPATH=.
```

Then you can run the program with:

```bash
python tactool/main.py --dev
conda activate tactool
tactool --dev
```

The `--dev` flag starts the application in developer mode, with a test image
Expand Down
52 changes: 0 additions & 52 deletions environments/macos-environment.yml

This file was deleted.

Binary file removed environments/unversioned-environment.yml
Binary file not shown.
61 changes: 0 additions & 61 deletions environments/windows-environment.yml

This file was deleted.

47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["."]
include = ["tactool"]

[project]
name = "tactool"
description = "TACtool: A targeting and co-ordination tool for spatial sampling and data traceability applied to scanning electron microscopy and laser ablation ICP-MS"
version = "1.3.1"
license = "GPL-3.0-only"
license-files = ["LICENSE"]
keywords = ["targeting", "co-ordination", "spatial", "traceability", "scanning", "electron", "microscopy", "sem", "laser", "ablation", "icp-ms", "gui"]
requires-python = ">=3.11"
dynamic = ["readme"]
dependencies = [
"numpy",
"pyqt5",
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
authors = [
{name="Leo Rudczenko", email="leorud@bgs.ac.uk"},
{name="John Stevenson", email="jostev@bgs.ac.uk"},
{name="Connor Newstead", email="connor.newstead@npl.co.uk"},
{name="Matthew Horstwood", email="msah@bgs.ac.uk"},
]

[project.urls]
repository = "https://github.com/BritishGeologicalSurvey/tactool/"

[project.optional-dependencies]
test = ["pytest", "flake8"]
pyinstaller = ["pyinstaller"]

[project.scripts]
tactool = "tactool.main:main"

[tool.setuptools.dynamic]
readme = {file = ["README.md"], content-type="text/markdown"}
7 changes: 6 additions & 1 deletion tactool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def recoordinate_dialog(self) -> RecoordinateDialog:
return self.window.recoordinate_dialog


if __name__ == "__main__":
def main() -> TACtool:
parser = argparse.ArgumentParser(description="Application for annotating images with analysis points.")
parser.add_argument(
"--dev",
Expand All @@ -105,3 +105,8 @@ def recoordinate_dialog(self) -> RecoordinateDialog:
args = parser.parse_args()

tactool_application = TACtool(sys.argv, developer_mode=args.dev, debug_mode=args.debug)
return tactool_application


if __name__ == "__main__":
main()