Skip to content

Commit

Permalink
Merge pull request #45 from clobrano/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
clobrano authored Jul 27, 2024
2 parents daca08f + 11e139b commit 78ebe5d
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 54 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches:
- release
- main
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
env:
PYTHONPATH: ./src
run: |
pytest
43 changes: 43 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CD
on:
workflow_dispatch:
inputs:
version:
description: "The version to release, without the leading `v`"
required: true

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install 'build[virtualenv]'
- name: Build package
run: |
python -m build
- name: Publish package to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install --upgrade twine
python -m twine upload dist/*
52 changes: 51 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
[metadata]
description-file = README.rst
name = letsdo
description = Time tracker for Command Line
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/clobrano/letsdo
author = Carlo Lobrano
author_email = [email protected]
license = GPL3
classifiers =
Development Status :: 5 - Production/Stable
Topic :: Utilities
keywords = productivity, GTD, time tracker

[options]
package_dir =
= src
packages = find:
install_requires =
docopt
PyYaml
terminaltables
parsedatetime
raffaello
include_package_data = True
py_modules =
app
cli
configuration
handlers
log
tasks
timetoolkit

[options.extras_require]
dev =
pytest>=7.0
twine>=4.0.2

[options.packages.find]
where = src

[options.entry_points]
console_scripts =
lets=cli:main

[tool:pytest]
addopts = -v

[tool.setuptools_scm]
write_to = src/letsdo/_version.py

48 changes: 2 additions & 46 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setuptool configuration for letsdo
"""
from setuptools import setup, find_packages

__version__ = "0.7.3"
from setuptools import setup

with open("README.md", "r", encoding="UTF-8") as f:
long_description = f.read()
setup()

setup(
name="letsdo",
version=__version__,
description="Time tracker for Command Line",
package_dir={"": "src"},
packages=find_packages("src"),
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/clobrano/letsdo",
author="Carlo Lobrano",
author_email="[email protected]",
license="GPL3",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Topic :: Utilities",
],
install_requires=[
"docopt",
"PyYaml",
"terminaltables",
"parsedatetime",
"raffaello",
],
extras_require={
"dev": ["pytest>=7.0", "twine>=4.0.2"],
},
entry_points={"console_scripts": ["lets=cli:main"]},
include_package_data=True,
keywords=["productivity", "GTD", "time tracker"],
py_modules=[
"app",
"cli",
"configuration",
"handlers",
"log",
"tasks",
"timetoolkit",
],
)
File renamed without changes.
11 changes: 5 additions & 6 deletions tests/test_base.py → src/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
"""Tests for letsdo"""
import os
import unittest
import tempfile
from time import sleep
from datetime import timedelta

from ..src.tasks import Task
from ..src.configuration import (
from tasks import Task
from configuration import (
create_default_configuration,
get_configuration,
get_task_file_path,
get_history_file_path,
)
from ..src.app import work_on
from ..src.app import group_task_by
from ..src.app import get_tasks
from app import work_on
from app import group_task_by
from app import get_tasks


class TestLetsdo(unittest.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# vi: set ft=python :
from datetime import datetime
from ..src.timetoolkit import format_h_m, strfdelta, str2datetime
from timetoolkit import format_h_m, strfdelta, str2datetime


def test_str2datetime():
Expand Down

0 comments on commit 78ebe5d

Please sign in to comment.