Compare commits

...

19 commits

Author SHA1 Message Date
Lance Edgar 8bddce1329 bump: version 0.4.4 → 0.4.5 2025-02-01 15:19:59 -06:00
Lance Edgar 542875a44c fix: purge email settings for wuttjamaican also 2024-12-18 19:07:30 -06:00
Lance Edgar 8bd4236291 bump: version 0.4.3 → 0.4.4 2024-10-03 10:36:07 -05:00
Lance Edgar 00b0082302 fix: update project source links, kallithea -> forgejo 2024-09-14 11:51:19 -05:00
Lance Edgar 515ccc9f0c docs: use markdown for readme file 2024-09-13 18:40:32 -05:00
Lance Edgar e2ce4fd257 bump: version 0.4.2 → 0.4.3 2024-08-06 23:20:33 -05:00
Lance Edgar fcfe741b51 fix: setup basic log files for CORE Lane 2024-08-04 10:11:45 -05:00
Lance Edgar 59ab46a335 fix: avoid rich traceback for overnight luigi commands 2024-08-03 11:54:42 -05:00
Lance Edgar 8ab21914bd fix: avoid rich traceback for backup script 2024-07-25 10:08:41 -05:00
Lance Edgar 9eb44fa172 fix: avoid rich traceback for overnight luigi commands 2024-07-18 10:09:56 -05:00
Lance Edgar 65a9a7c9be fix: install more dependencies for borg 2024-07-18 10:09:47 -05:00
Lance Edgar 5ffcf0297c fix: install emacs-common-non-dfsg only if available
which it is not always, depending on apt sources
2024-07-12 12:00:39 -05:00
Lance Edgar 7d031e1a41 bump: version 0.4.1 → 0.4.2 2024-07-05 11:10:21 -05:00
Lance Edgar 04c586a11e fix: install non-dfsg package for emacs
for sake of tramp info manual

cf. https://www.reddit.com/r/emacs/comments/d6r3dt/comment/f0vujx6/
2024-07-03 14:18:29 -05:00
Lance Edgar d0425115da fix: remove references, dependency for six package 2024-07-01 16:35:08 -05:00
Lance Edgar 8b5bb956ae bump: version 0.4.0 → 0.4.1 2024-06-30 11:12:39 -05:00
Lance Edgar 5c5038144f fix: always install venv pkg when bootstrapping python 2024-06-15 21:17:42 -05:00
Lance Edgar 014982028b bump: version 0.3.6 → 0.4.0 2024-06-10 19:14:58 -05:00
Lance Edgar 8c51ee8735 feat: switch from setup.cfg to pyproject.toml + hatchling 2024-06-10 19:12:50 -05:00
21 changed files with 167 additions and 88 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
*~
*.pyc
dist/
rattail_fabric2.egg-info/

53
CHANGELOG.md Normal file
View file

@ -0,0 +1,53 @@
# Changelog
All notable changes to rattail-fabric2 will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## v0.4.5 (2025-02-01)
### Fix
- purge email settings for wuttjamaican also
## v0.4.4 (2024-10-03)
### Fix
- update project source links, kallithea -> forgejo
## v0.4.3 (2024-08-06)
### Fix
- setup basic log files for CORE Lane
- avoid rich traceback for overnight luigi commands
- avoid rich traceback for backup script
- avoid rich traceback for overnight luigi commands
- install more dependencies for borg
- install `emacs-common-non-dfsg` only if available
## v0.4.2 (2024-07-05)
### Fix
- install non-dfsg package for emacs
- remove references, dependency for `six` package
## v0.4.1 (2024-06-30)
### Fix
- always install `venv` pkg when bootstrapping python
## v0.4.0 (2024-06-10)
### Feat
- switch from setup.cfg to pyproject.toml + hatchling
## Older Releases
Please see `docs/OLDCHANGES.rst` for older release notes.

11
README.md Normal file
View file

@ -0,0 +1,11 @@
# rattail-fabric2
Rattail is a retail software framework, released under the GNU General Public
License.
This package contains various utility functions for use with
[Fabric](http://www.fabfile.org/) (v2).
Please see Rattail's [home page](https://rattailproject.org/) for more
information.

View file

@ -1,14 +0,0 @@
rattail-fabric2
===============
Rattail is a retail software framework, released under the GNU General Public
License.
This package contains various utility functions for use with `Fabric`_ (v2).
.. _`Fabric`: http://www.fabfile.org/
Please see Rattail's `home page`_ for more information.
.. _`home page`: https://rattailproject.org/

View file

@ -2,8 +2,9 @@
CHANGELOG
=========
Unreleased
----------
NB. this file contains "old" release notes only. for newer releases
see the `CHANGELOG.md` file in the source root folder.
0.3.6 (2024-05-31)
------------------

41
pyproject.toml Normal file
View file

@ -0,0 +1,41 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "rattail-fabric2"
version = "0.4.5"
description = "Fabric (v2) Utilities for Rattail"
readme = "README.md"
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
license = {text = "GNU GPL v3+"}
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: System :: Systems Administration",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"fabric2",
"invoke",
"rattail",
]
[project.urls]
Homepage = "https://rattailproject.org"
Repository = "https://forgejo.wuttaproject.org/rattail/rattail-fabric2"
Changelog = "https://forgejo.wuttaproject.org/rattail/rattail-fabric2/src/branch/master/CHANGELOG.md"
[tool.commitizen]
version_provider = "pep621"
tag_format = "v$version"
update_changelog_on_bump = true

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8; -*-
__version__ = '0.3.6'
try:
from importlib.metadata import version
except ImportError:
from importlib_metadata import version
__version__ = version('rattail-fabric2')

View file

@ -112,4 +112,10 @@ def install_emacs(c):
if ubuntu_version and ubuntu_version < 16:
emacs = 'emacs23-nox'
install(c, emacs, 'emacs-goodies-el')
install(c, emacs,
'emacs-goodies-el',
)
# nb. this includes tramp manual
if c.sudo('dpkg -s emacs-common-non-dfsg', warn=True).ok:
install(c, 'emacs-common-non-dfsg')

View file

@ -103,7 +103,7 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
# rattail
mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user)
if not exists(c, os.path.join(envpath, 'src/rattail')):
c.sudo('git clone https://kallithea.rattailproject.org/rattail-project/rattail {}/src/rattail'.format(envpath), user=user)
c.sudo(f'git clone https://forgejo.wuttaproject.org/rattail/rattail.git {envpath}/src/rattail', user=user)
c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install --editable {0}/src/rattail'".format(envpath),
user=user)
deploy_generic(c, 'backup/git-exclude', os.path.join(envpath, 'src/rattail/.git/info/exclude'), use_sudo=True, owner=user)

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2018 Lance Edgar
# Copyright © 2010-2024 Lance Edgar
#
# This file is part of Rattail.
#
@ -26,8 +26,6 @@ Fabric library for Borg backups
https://www.borgbackup.org/
"""
from __future__ import unicode_literals, absolute_import
from rattail_fabric2 import apt
@ -39,6 +37,9 @@ def install_dependencies(c):
c,
'libacl1-dev',
'libfuse-dev',
'liblz4-dev',
'libssl-dev',
'libxxhash-dev',
'libzstd-dev',
'pkg-config',
)

View file

@ -33,7 +33,7 @@ def install_from_source(c, user='rattail'):
"""
if not exists(c, '/usr/local/src/byjove'):
mkdir(c, '/usr/local/src/byjove', use_sudo=True, owner=user)
c.sudo('git clone https://kallithea.rattailproject.org/rattail-project/byjove /usr/local/src/byjove',
c.sudo('git clone https://forgejo.wuttaproject.org/rattail/byjove.git /usr/local/src/byjove',
user=user)
c.sudo("bash -l -c 'cd /usr/local/src/byjove; npm link'",
user=user)

View file

@ -107,12 +107,18 @@ def install_corepos(c, rootdir, rooturl_office, production=True,
'mysql_password': mysql_password,
'mysql_name_prefix': mysql_name_prefix})
# fannie logging
# office logging
mkdir(c, f'{is4c}/fannie/logs', use_sudo=True,
owner=f'{user}:www-data', mode='0775')
c.sudo(f"bash -c 'cd {is4c}/fannie/logs && touch fannie.log debug_fannie.log'",
user='www-data')
# lane logging
mkdir(c, f'{is4c}/pos/is4c-nf/log', use_sudo=True,
owner=f'{user}:www-data', mode='0775')
c.sudo(f"bash -c 'cd {is4c}/pos/is4c-nf/log && touch lane.log debug_lane.log'",
user='www-data')
# TODO: deprecate / remove this
def install_fannie(c, rootdir, user='www-data', branch='version-2.10',

View file

@ -11,6 +11,8 @@ else
fi
RATTAIL="/srv/envs/${envname}/bin/rattail --config=$CONFIG $PROGRESS $VERBOSE"
# nb. avoid rich-formatted traceback here since it's so "noisy"
export _TYPER_STANDARD_TRACEBACK=1
# sanity check

View file

@ -3,6 +3,8 @@
cd ${envroot}
export RATTAIL_CONFIG_FILES=${overnight_conf}
# nb. avoid rich-formatted traceback here since it's so "noisy"
export _TYPER_STANDARD_TRACEBACK=1
bin/rattail --no-versioning overnight -k ${automation.lower()} <%text>\</%text>
% if email_key is not Undefined and email_key:

View file

@ -3,6 +3,8 @@
cd ${envroot}
export RATTAIL_CONFIG_FILES=${overnight_conf}
# nb. avoid rich-formatted traceback here since it's so "noisy"
export _TYPER_STANDARD_TRACEBACK=1
bin/rattail --no-versioning overnight -k ${automation.lower()} <%text>\</%text>
% if email_key is not Undefined and email_key:

View file

@ -50,6 +50,7 @@ def bootstrap_python(c, deploy=None,
apt.install(
c,
'python3-dev',
'python3-venv',
'libffi-dev',
'libjpeg-dev',
'libssl-dev',

View file

@ -108,6 +108,14 @@ def delete_email_recipients(c, dbname):
"""
Purge all email recipient settings for the given database.
"""
# purge new-style for wuttjamaican
postgresql.sql(c, "delete from setting where name like 'rattail.email.%.sender';", database=dbname)
postgresql.sql(c, "delete from setting where name like 'rattail.email.%.to';", database=dbname)
postgresql.sql(c, "delete from setting where name like 'rattail.email.%.cc';", database=dbname)
postgresql.sql(c, "delete from setting where name like 'rattail.email.%.bcc';", database=dbname)
# purge old-style for rattail
postgresql.sql(c, "delete from setting where name like 'rattail.mail.%.from';", database=dbname)
postgresql.sql(c, "delete from setting where name like 'rattail.mail.%.to';", database=dbname)
postgresql.sql(c, "delete from setting where name like 'rattail.mail.%.cc';", database=dbname)
postgresql.sql(c, "delete from setting where name like 'rattail.mail.%.bcc';", database=dbname)

View file

@ -111,8 +111,6 @@ def append(c, filename, text, use_sudo=False, partial=False, escape=True,
"""
func = use_sudo and c.sudo or c.run
# Normalize non-list input to be a list
# TODO: do we need to check for six.something here?
# if isinstance(text, basestring):
if isinstance(text, str):
text = [text]
for line in text:

View file

@ -1,33 +0,0 @@
# -*- coding: utf-8; -*-
[metadata]
name = rattail-fabric2
version = attr: rattail_fabric2.__version__
author = Lance Edgar
author_email = lance@edbob.org
url = https://rattailproject.org/
license = GNU GPL v3
description = Fabric (v2) Utilities for Rattail
long_description = file: README.rst
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Developers
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python :: 3
Topic :: System :: Systems Administration
Topic :: Software Development :: Libraries :: Python Modules
[options]
install_requires =
fabric2
invoke
rattail
six
packages = find:
include_package_data = True
zip_safe = False

View file

@ -1,26 +0,0 @@
# -*- coding: utf-8; -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
# Rattail is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# Rattail. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from setuptools import setup
setup()

View file

@ -25,13 +25,24 @@ Tasks for rattail-fabric2
"""
import os
import re
import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'rattail_fabric2', '_version.py')).read())
__version__ = None
pattern = re.compile(r'^version = "(\d+\.\d+\.\d+)"$')
with open(os.path.join(here, 'pyproject.toml'), 'rt') as f:
for line in f:
line = line.rstrip('\n')
match = pattern.match(line)
if match:
__version__ = match.group(1)
break
if not __version__:
raise RuntimeError("could not parse version!")
@task
@ -39,9 +50,10 @@ def release(c):
"""
Release a new version of 'rattail-fabric2'.
"""
shutil.rmtree('rattail_fabric2.egg-info')
if os.path.exists('rattail_fabric2.egg-info'):
shutil.rmtree('rattail_fabric2.egg-info')
# TODO: this seems heavy-handed? for sake of recursive-include in MANIFEST
# TODO: what i esp. don't like is, this doesn't consider .gitignore
c.run("find . -name '*~' -delete")
c.run('python setup.py sdist --formats=gztar')
c.run('python -m build --sdist')
c.run(f'twine upload dist/rattail_fabric2-{__version__}.tar.gz')