Compare commits
21 commits
Author | SHA1 | Date | |
---|---|---|---|
|
8bddce1329 | ||
|
542875a44c | ||
![]() |
8bd4236291 | ||
![]() |
00b0082302 | ||
![]() |
515ccc9f0c | ||
![]() |
e2ce4fd257 | ||
![]() |
fcfe741b51 | ||
![]() |
59ab46a335 | ||
![]() |
8ab21914bd | ||
![]() |
9eb44fa172 | ||
![]() |
65a9a7c9be | ||
![]() |
5ffcf0297c | ||
![]() |
7d031e1a41 | ||
![]() |
04c586a11e | ||
![]() |
d0425115da | ||
![]() |
8b5bb956ae | ||
![]() |
5c5038144f | ||
![]() |
014982028b | ||
![]() |
8c51ee8735 | ||
![]() |
4e3b8f6520 | ||
![]() |
be728e9bb3 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
|||
*~
|
||||
*.pyc
|
||||
dist/
|
||||
rattail_fabric2.egg-info/
|
||||
|
|
53
CHANGELOG.md
Normal file
53
CHANGELOG.md
Normal 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
11
README.md
Normal 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.
|
14
README.rst
14
README.rst
|
@ -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/
|
|
@ -2,8 +2,15 @@
|
|||
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)
|
||||
------------------
|
||||
|
||||
* Bump version to fix PyPI upload.
|
||||
|
||||
|
||||
0.3.5 (2024-05-31)
|
||||
------------------
|
41
pyproject.toml
Normal file
41
pyproject.toml
Normal 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
|
|
@ -1,3 +1,9 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
|
||||
__version__ = '0.3.5'
|
||||
try:
|
||||
from importlib.metadata import version
|
||||
except ImportError:
|
||||
from importlib_metadata import version
|
||||
|
||||
|
||||
__version__ = version('rattail-fabric2')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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',
|
||||
)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -50,6 +50,7 @@ def bootstrap_python(c, deploy=None,
|
|||
apt.install(
|
||||
c,
|
||||
'python3-dev',
|
||||
'python3-venv',
|
||||
'libffi-dev',
|
||||
'libjpeg-dev',
|
||||
'libssl-dev',
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
34
setup.cfg
34
setup.cfg
|
@ -1,34 +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
|
||||
Programming Language :: Python :: 3.5
|
||||
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
|
26
setup.py
26
setup.py
|
@ -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()
|
24
tasks.py
24
tasks.py
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2020 Lance Edgar
|
||||
# Copyright © 2010-2024 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -24,16 +24,25 @@
|
|||
Tasks for rattail-fabric2
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
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
|
||||
|
@ -41,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('twine upload dist/rattail-fabric2-{}.tar.gz'.format(__version__))
|
||||
c.run('python -m build --sdist')
|
||||
c.run(f'twine upload dist/rattail_fabric2-{__version__}.tar.gz')
|
||||
|
|
Loading…
Reference in a new issue