Skip to content

Commit

Permalink
added release file and editing test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilkka-LBL committed Oct 28, 2024
1 parent 0955dbd commit 62d4ee6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
name: CI - Run Unit Tests
name: CI - Run Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test:
name: Run Tests
name: Run Unit Tests
runs-on: ubuntu-latest

steps:
- name: Check out the repository
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: 3.x

- name: Install dependencies
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r requirements.txt
pip install -r requirements.txt
- name: Print Working Directory
run: pwd # Confirm current working directory

- name: List All Files
run: ls -R # Show all files to confirm where 'tests' is located

- name: Run Unit Tests
env:
PYTHONPATH: . # Add root directory to PYTHONPATH for imports
run: |
python -m unittest discover -s tests -p "test_*.py" # Discover and run tests in 'tests'
- name: Run tests
# Run a single test file as a backup in case of discovery issues
- name: Run Single Test (Fallback)
if: failure()
run: |
python -m unittest discover -s ./tests
python -m unittest tests/test_TFL.py # Replace with an actual test file in your 'tests' directory
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
# Add the parent directory to sys.path to allow imports
sys.path.insert(0, os.path.abspath('../../'))

with open('release.txt') as f:
version = f.read()

project = 'Consensus'
copyright = '2024, Ilkka Sipila - Lewisham Council Data Science and Insight team'
author = 'Ilkka Sipila'
release = '1.0.3'
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
1 change: 1 addition & 0 deletions release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.4
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
with open('README.md') as f:
long_description = f.read()

with open('release.txt') as f:
version = f.read()


class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
Expand Down Expand Up @@ -45,7 +48,7 @@ def package_files(directory):

setup(
name='Consensus',
version='1.0.3',
version=version,
author='Ilkka Sipila',
author_email='ilkka.sipila@lewisham.gov.uk',
website='https://ilkka-lbl.github.io/Consensus/',
Expand Down

0 comments on commit 62d4ee6

Please sign in to comment.