take cwd as base directory

This commit is contained in:
Torsten Ueberschar
2024-09-17 10:10:33 +02:00
parent 660e75d719
commit c9c34493b8
3 changed files with 20 additions and 42 deletions

View File

@@ -13,11 +13,17 @@ python -m venv .venv
source .venv/bin/activate
```
Build and install executable:
Build executable:
```bash
python setup.py build
python setup.py install
pip install --upgrade build
python -m build
```
Install the executable:
```bash
pip install .
```
See where it is installed:
@@ -27,6 +33,13 @@ which invoice
## usage
```bash
invoice -h
```
There are two yaml files describing your invoice:
- `invoice.yaml` contains the invoice data

View File

@@ -1,36 +0,0 @@
from setuptools import setup, find_packages
setup(
name='simple-invoice-generator',
version='0.1.0',
description='Simple invoice generator for freelancers and small businesses',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author='Torsten Ueberschar',
author_email='tu@uesome.de',
url='https://git.uesome.de/torsten/simple-invoice-generator',
packages=find_packages('src'),
package_dir={'': 'src'},
install_requires=[
'PyYAML',
'Jinja2',
'xhtml2pdf',
'Markdown',
],
extras_require={
'dev': ['pytest', 'coverage'],
# Extra dependencies for development and testing
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers, Freelancers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.10',
# Add more classifiers as needed
],
entry_points={
'console_scripts': [
'invoice = main:main',
]
}
)

View File

@@ -52,11 +52,12 @@ def main():
print('Simple invoice generator for freelancers and small businesses by Torsten Ueberschar')
print()
parser = argparse.ArgumentParser(description='Read invoice and envelope data from yaml file')
parser.add_argument('-b', '--base', type=str, required=False, default=f'{cwd}', help='base directory for invoice and envelope files')
parser.add_argument('-b', '--base', type=str, required=False, default=cwd,
help='base directory for invoice and envelope files (default: (current working directory) %(default)s)')
parser.add_argument('-e', '--envelope', type=str, required=False, default='envelope.yaml',
help='Envelope file name')
help='Envelope file name (default: %(default)s)')
parser.add_argument('-t', '--template', type=str, required=False, default='templates',
help='directory for template files')
help='directory for template files (default: %(default)s)')
parser.add_argument('-i', '--invoice', type=str, required=True, help='Invoice file name')
args = parser.parse_args()