Skip to content

Commit 9e7bfd2

Browse files
author
Matthew Armstrong
committed
fix: log shouldn't be called before folder is created
chore: update pre-commit steps chore: add icons to installer and exe docs: added more detail on release steps
1 parent 314f8e5 commit 9e7bfd2

File tree

10 files changed

+27
-73
lines changed

10 files changed

+27
-73
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
# Ruff version.
4-
rev: v0.2.1
3+
rev: v0.9.6
54
hooks:
6-
# Run the linter.
75
- id: ruff
86
args: [ --fix ]
9-
# Run the formatter.
10-
- id: ruff-format
7+
- id: ruff-format
8+
9+
- repo: local
10+
hooks:
11+
- id: compile_check
12+
name: compile_check
13+
language: python
14+
entry: python -W error -m compileall src
15+
types: [python]
16+
stages: [pre-commit]
17+
pass_filenames: false

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ An application to manipulate postcode data.
77
- **Python 3**
88
- **Python virtual environment** - Setup a folder called `.venv` with `python -m venv .venv` and activate with `.\\.venv\\Scripts\\activate`
99
- **Dependencies** - Installed by running `pip install -e .[dev]` (remember to do so from inside a virtual environment)
10+
- **Setup Pre-commit hooks** - run `pre-commit install`
11+
12+
## Create Release
13+
14+
- Update version number
15+
- `pyproject.toml`
16+
- `postcode_parser.iss`
17+
- `src/postcode_parse/_version.py`
1018

1119
## Build Exe
1220

13-
- `pyinstaller --onefile src/postcode_parse/postcode_parse.py --clean`
21+
- `pyinstaller --onefile src/postcode_parse/postcode_parse.py --clean --icon=assets/postcode.ico --distpath=./`
1422
- Compile the `postcode_parser.iss` in Inno Setup Compiler
1523
- Run the installer (to install or to update)
1624

assets/postcode.ico

66.1 KB
Binary file not shown.

assets/postcode.png

-195 KB
Loading

postcode_parser.iss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "PostcodeParser"
5-
#define MyAppVersion "1.0"
5+
#define MyAppVersion "1.0.1"
66
#define MyAppPublisher "Matthew Armstrong"
77
#define MyAppExeName "postcode_parse.exe"
88

@@ -14,6 +14,7 @@ AppName={#MyAppName}
1414
AppVersion={#MyAppVersion}
1515
;AppVerName={#MyAppName} {#MyAppVersion}
1616
AppPublisher={#MyAppPublisher}
17+
SetupIconFile=assets\postcode.ico
1718
DefaultDirName={autopf}\{#MyAppName}
1819
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
1920
; on anything but x64 and Windows 11 on Arm.
@@ -39,7 +40,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
3940
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
4041

4142
[Files]
42-
Source: "C:\Users\marms\Documents\Repos\PostcodeParse\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
43+
Source: "{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
4344
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
4445

4546
[Icons]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"questionary==2.0.1",
1212
"tqdm==4.64.1"
1313
]
14-
version = "0.0.0"
14+
version = "1.0.1"
1515

1616
[project.optional-dependencies]
1717
dev = [

src/postcode_parse/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "1.0.1"

src/postcode_parse/postcode_parse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import csv
44
import os
55
import re
6-
import shutil
76
from sys import exit
87
from typing import Dict, Iterator, List, Tuple, Union
98

@@ -140,7 +139,7 @@ def retrieve_coords_ons(ons_data_path: str, postcode: str) -> Tuple[Union[str, N
140139

141140
def create_folder(path: str) -> None:
142141
if not os.path.exists(path):
143-
logger.debug(f"Creating folder at {path}")
142+
# print(f"Creating folder at {path}")
144143
os.makedirs(path)
145144

146145

tests/ONSPD_TEST.csv

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/PAF-TEST.csv

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)