Skip to content

Commit 78ebe5d

Browse files
authored
Merge pull request #45 from clobrano/release
Release
2 parents daca08f + 11e139b commit 78ebe5d

File tree

8 files changed

+135
-54
lines changed

8 files changed

+135
-54
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
- main
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.12'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Run tests
30+
env:
31+
PYTHONPATH: ./src
32+
run: |
33+
pytest

.github/workflows/release.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CD
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: "The version to release, without the leading `v`"
7+
required: true
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
needs: build
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
pip install 'build[virtualenv]'
31+
32+
- name: Build package
33+
run: |
34+
python -m build
35+
36+
- name: Publish package to PyPI
37+
env:
38+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
39+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
40+
run: |
41+
python -m pip install --upgrade twine
42+
python -m twine upload dist/*
43+

setup.cfg

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
[metadata]
2-
description-file = README.rst
2+
name = letsdo
3+
description = Time tracker for Command Line
4+
long_description = file: README.md
5+
long_description_content_type = text/markdown
6+
url = https://github.com/clobrano/letsdo
7+
author = Carlo Lobrano
8+
author_email = [email protected]
9+
license = GPL3
10+
classifiers =
11+
Development Status :: 5 - Production/Stable
12+
Topic :: Utilities
13+
keywords = productivity, GTD, time tracker
14+
15+
[options]
16+
package_dir =
17+
= src
18+
packages = find:
19+
install_requires =
20+
docopt
21+
PyYaml
22+
terminaltables
23+
parsedatetime
24+
raffaello
25+
include_package_data = True
26+
py_modules =
27+
app
28+
cli
29+
configuration
30+
handlers
31+
log
32+
tasks
33+
timetoolkit
34+
35+
[options.extras_require]
36+
dev =
37+
pytest>=7.0
38+
twine>=4.0.2
39+
40+
[options.packages.find]
41+
where = src
42+
43+
[options.entry_points]
44+
console_scripts =
45+
lets=cli:main
46+
47+
[tool:pytest]
48+
addopts = -v
49+
50+
[tool.setuptools_scm]
51+
write_to = src/letsdo/_version.py
52+

setup.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
"""
4-
Setuptool configuration for letsdo
5-
"""
6-
from setuptools import setup, find_packages
73

8-
__version__ = "0.7.3"
4+
from setuptools import setup
95

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

13-
setup(
14-
name="letsdo",
15-
version=__version__,
16-
description="Time tracker for Command Line",
17-
package_dir={"": "src"},
18-
packages=find_packages("src"),
19-
long_description=long_description,
20-
long_description_content_type="text/markdown",
21-
url="https://github.com/clobrano/letsdo",
22-
author="Carlo Lobrano",
23-
author_email="[email protected]",
24-
license="GPL3",
25-
classifiers=[
26-
"Development Status :: 5 - Production/Stable",
27-
"Topic :: Utilities",
28-
],
29-
install_requires=[
30-
"docopt",
31-
"PyYaml",
32-
"terminaltables",
33-
"parsedatetime",
34-
"raffaello",
35-
],
36-
extras_require={
37-
"dev": ["pytest>=7.0", "twine>=4.0.2"],
38-
},
39-
entry_points={"console_scripts": ["lets=cli:main"]},
40-
include_package_data=True,
41-
keywords=["productivity", "GTD", "time tracker"],
42-
py_modules=[
43-
"app",
44-
"cli",
45-
"configuration",
46-
"handlers",
47-
"log",
48-
"tasks",
49-
"timetoolkit",
50-
],
51-
)
File renamed without changes.

tests/test_base.py renamed to src/tests/test_base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
"""Tests for letsdo"""
44
import os
55
import unittest
6-
import tempfile
76
from time import sleep
87
from datetime import timedelta
98

10-
from ..src.tasks import Task
11-
from ..src.configuration import (
9+
from tasks import Task
10+
from configuration import (
1211
create_default_configuration,
1312
get_configuration,
1413
get_task_file_path,
1514
get_history_file_path,
1615
)
17-
from ..src.app import work_on
18-
from ..src.app import group_task_by
19-
from ..src.app import get_tasks
16+
from app import work_on
17+
from app import group_task_by
18+
from app import get_tasks
2019

2120

2221
class TestLetsdo(unittest.TestCase):
File renamed without changes.

tests/test_timetoolkit.py renamed to src/tests/test_timetoolkit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
# vi: set ft=python :
44
from datetime import datetime
5-
from ..src.timetoolkit import format_h_m, strfdelta, str2datetime
5+
from timetoolkit import format_h_m, strfdelta, str2datetime
66

77

88
def test_str2datetime():

0 commit comments

Comments
 (0)