take cwd as base directory
This commit is contained in:
19
README.md
19
README.md
@@ -13,11 +13,17 @@ python -m venv .venv
|
|||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
```
|
```
|
||||||
|
|
||||||
Build and install executable:
|
Build executable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python setup.py build
|
pip install --upgrade build
|
||||||
python setup.py install
|
python -m build
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the executable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install .
|
||||||
```
|
```
|
||||||
|
|
||||||
See where it is installed:
|
See where it is installed:
|
||||||
@@ -27,6 +33,13 @@ which invoice
|
|||||||
|
|
||||||
## usage
|
## usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
invoice -h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
There are two yaml files describing your invoice:
|
There are two yaml files describing your invoice:
|
||||||
|
|
||||||
- `invoice.yaml` contains the invoice data
|
- `invoice.yaml` contains the invoice data
|
||||||
|
|||||||
36
setup.py
36
setup.py
@@ -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',
|
|
||||||
]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -52,11 +52,12 @@ def main():
|
|||||||
print('Simple invoice generator for freelancers and small businesses by Torsten Ueberschar')
|
print('Simple invoice generator for freelancers and small businesses by Torsten Ueberschar')
|
||||||
print()
|
print()
|
||||||
parser = argparse.ArgumentParser(description='Read invoice and envelope data from yaml file')
|
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',
|
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',
|
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')
|
parser.add_argument('-i', '--invoice', type=str, required=True, help='Invoice file name')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|||||||
Reference in New Issue
Block a user