From 5fb47aa4c065181364e3557b499b952fc132d832 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 17 Aug 2019 01:27:45 -0500 Subject: [PATCH 01/18] Add tasks file, w/ "release" task now version 0.1.0 lives on PyPI --- setup.py | 4 ++-- tasks.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 tasks.py diff --git a/setup.py b/setup.py index 49d9d72..bcb5e8e 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,7 @@ requires = [ # # package # low high + 'invoke', # 1.3.0 'psycopg2', # 2.6.2 'rattail[auth,db,bouncer]', # 0.7.25 'Tailbone', # 0.5.29 @@ -80,7 +81,6 @@ setup( long_description = README, classifiers = [ - 'Private :: Do Not Upload', 'Development Status :: 3 - Alpha', 'Environment :: Console', 'Environment :: Web Environment', @@ -89,7 +89,7 @@ setup( 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', 'Topic :: Office/Business', ], diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..f542632 --- /dev/null +++ b/tasks.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# Rattail -- Retail Software Framework +# Copyright © 2010-2019 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 . +# +################################################################################ +""" +Tasks for 'rattail-tutorial' package +""" + +import os + +from invoke import task + + +here = os.path.abspath(os.path.dirname(__file__)) +exec(open(os.path.join(here, 'rattail_tutorial', '_version.py')).read()) + + +@task +def release(c): + """ + Release a new version of `rattail-tutorial`. + """ + c.run('rm -rf rattail_tutorial.egg-info') + c.run('python setup.py sdist --formats=gztar') + c.run('twine upload dist/rattail-tutorial-{}.tar.gz'.format(__version__)) From 6285ba3cc82e40cb1fa5bd05279015f4e43485cb Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 17 Aug 2019 02:41:26 -0500 Subject: [PATCH 02/18] Add docs for building a version release for project --- docs/index.rst | 1 + docs/pkg-release.rst | 118 +++++++++++++++++++++++++++++++++++++++++++ docs/start-docs.rst | 4 +- 3 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 docs/pkg-release.rst diff --git a/docs/index.rst b/docs/index.rst index 687f895..d294cea 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -55,6 +55,7 @@ Table of Contents create-project start-docs configure + pkg-release Indices and tables diff --git a/docs/pkg-release.rst b/docs/pkg-release.rst new file mode 100644 index 0000000..b65a054 --- /dev/null +++ b/docs/pkg-release.rst @@ -0,0 +1,118 @@ + +.. highlight:: sh + +Build a Release for the Project +=============================== + +Even though our app does very little at this stage, we wish to go ahead and +"release" our first version for it. + +.. note:: + Whether or not you actually need to build releases for your project, may + depend on your use case. For instance if you have reason to run the app(s) + directly from source (i.e. git HEAD) then you may have no use for a built + package. + + +Project Versioning +------------------ + +The project's current version "number" is kept in only one place really, in our +case ``~/src/rattail-tutorial/rattail_tutorial/_version.py``. Other files are +configured to read the current project version from there. + +The initial version for a new project will generally be '0.1.0' and it's +assumed that subsequent versions will be '0.1.1' then '0.1.2' etc. until you've +decided that it's time to do a '0.2.0' release, and the cycle begins again. + +You can be as aggressive or conservative as you like when it comes to +incrementing the more "major" parts of the version number, e.g. you can +increment conservatively to where you've just released say, '0.1.427' before you +finally go to '0.2.0'. The only real "requirement" (assumption) here is that +you will build a new version release *every time* you update the production +environment(s). Sometimes that may mean multiple releases in a given day, +e.g. if the first one ships with a bug and you have to push a release to fix. + + +Install Invoke +-------------- + +While you can most certainly go about the build/release task in various ways, +the convention within Rattail-land is to use `Invoke`_. + +.. _Invoke: https://www.pyinvoke.org/ + +So next we'll install that to your virtualenv:: + + pip install invoke + +You may also want to declare this within your project's dependencies (in +``setup.py``), but that's up to you. + + +Create Tasks File +----------------- + +The ``invoke`` command will invoke tasks which we have defined in a tasks file. +(Duh!) + +We will now create a file at ``~/src/rattail-tutorial/tasks.py`` and in it +place some minimal contents: + +.. code-block:: python3 + + # -*- coding: utf-8; -*- + """ + Tasks for 'rattail-tutorial' project + """ + + from invoke import task + + # this is needed to read current `__version__` value + #import os + #here = os.path.abspath(os.path.dirname(__file__)) + #exec(open(os.path.join(here, 'rattail_tutorial', '_version.py')).read()) + + + @task + def release(c): + """ + Release a new version of `rattail-tutorial`. + """ + # clear out previous package info + c.run('rm -rf rattail_tutorial.egg-info') + + # build fresh package! + c.run('python setup.py sdist --formats=gztar') + + # enable this if you intend to publish package to PyPI + #c.run('twine upload dist/rattail-tutorial-{}.tar.gz'.format(__version__)) + +If you're creating your own project then you can use the above as a starting +point for your own file. Instead of using ``twine`` to upload the package to +`PyPI`_, you may need to push to some private package repository which you +control. + +.. _PyPI: https://pypi.org/ + + +Run Release Task +---------------- + +As you can see above, ``release`` is the one and only task we have defined so +far. In most cases that will be the only task you ever define for the project, +but YMMV. + +At any rate it's all we need for now, so let's run it:: + + cd ~/src/rattail-tutorial + invoke release + +If you're feeling lazy you can even shorten that second one to:: + + inv release + +This will build a new "release" which may then be found within e.g. the +``~/src/rattail-tutorial/dist/`` folder. Depending on the specifics of your +tasks file, this release may also be uploaded to some (public or private) +package index. diff --git a/docs/start-docs.rst b/docs/start-docs.rst index 4b937f7..1878a2a 100644 --- a/docs/start-docs.rst +++ b/docs/start-docs.rst @@ -1,8 +1,8 @@ .. highlight:: sh -Documenting Your Project -======================== +Document Your Project +===================== At this point we assume you already have created a new project, and established the Git repo for it etc. From 1660774ad2b5bdc979551b341ab31c4612ac0f7f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 17 Aug 2019 03:47:46 -0500 Subject: [PATCH 03/18] Add docs for establishing main app DB --- docs/index.rst | 1 + docs/make-db.rst | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 docs/make-db.rst diff --git a/docs/index.rst b/docs/index.rst index d294cea..67812ad 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -56,6 +56,7 @@ Table of Contents start-docs configure pkg-release + make-db Indices and tables diff --git a/docs/make-db.rst b/docs/make-db.rst new file mode 100644 index 0000000..6ebeee3 --- /dev/null +++ b/docs/make-db.rst @@ -0,0 +1,85 @@ + +.. highlight:: sh + +Establish Main App Database +=========================== + +Now that you have a hang of how to use the Rattail-style command line +(somewhat), let's move on to the database. + +The main reason to wait until now to add a DB to the mix, was simply to show +that the "core" of Rattail does not need a DB. However in practice there *are* +definitely some commands which Rattail comes with out of the box, and which +also would require one or even multiple databases to be present. + + +Create User for PostgreSQL +-------------------------- + +Before we make our database, let's first establish a user account within +Postgres, which we will designate as the "owner" of our database(s). + +It is convention within Rattail, to create a PG user named "rattail" for this +purpose. You are free to use another name if you prefer:: + + sudo -u postgres createuser --no-createdb --no-createrole --no-superuser rattail + +You also should declare a password for the user:: + + sudo -u postgres psql -c "alter user rattail password 'newpassword'" + + +Create Database +--------------- + +Now that we know who to use as the "owner" we will create a new Postgres +database:: + + sudo -u postgres createdb --owner rattail rattut + +Of course we named our database "rattut" here only because we're assuming this +tutorial project is the app, but your name may be different. + +At this point you should update your ``app/rattail.conf`` file to reflect your +chosen database name and user credentials: + +.. code-block:: ini + + [rattail.db] + default.url = postgresql://rattail:newpassword@localhost/rattut + + +Install DB Schema +----------------- + +So you have a DB but it’s empty; you can confirm that with:: + + sudo -u postgres psql -c '\d' rattut + +But we'll fix that now. Schema is managed entirely via Alembic "version" +scripts, so to install the schema we merely run all the scripts:: + + cdvirtualenv + bin/alembic -c app/rattail.conf upgrade heads + +(Note that you must use ``rattail.conf`` for that; ``quiet.conf`` won't work.) + +If you check the DB again you should see a good amount of tables. + + +Create Admin User in DB +----------------------- + +We include this here not so much because you *need* an admin user in your DB at +this point (although you will for the web app), but rather just to confirm that +everything is setup correctly thus far. + +You currently should have no users in your DB:: + + sudo -u postgres psql -c 'select * from "user"' rattut + +Okay then let's make an admin user for you:: + + bin/rattail -c app/quiet.conf make-user --admin myusername + +Now if you query the ``user`` table again you should see your new account. From 2adb18534c15c1dcab74689bf778cc0118ba623f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 17 Aug 2019 18:54:04 -0500 Subject: [PATCH 04/18] Add docs for running web app --- Vagrantfile | 3 ++ docs/index.rst | 1 + docs/make-db.rst | 2 ++ docs/run-webapp.rst | 77 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 docs/run-webapp.rst diff --git a/Vagrantfile b/Vagrantfile index 0c359c8..5da7689 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,4 +5,7 @@ Vagrant.configure("2") do |config| # target machine runs Debian 10 "buster" config.vm.box = "debian/buster64" + # rattail-tutorial web app + config.vm.network "forwarded_port", guest: 9080, host: 9080 + end diff --git a/docs/index.rst b/docs/index.rst index 67812ad..71020c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,6 +57,7 @@ Table of Contents configure pkg-release make-db + run-webapp Indices and tables diff --git a/docs/make-db.rst b/docs/make-db.rst index 6ebeee3..b4d437e 100644 --- a/docs/make-db.rst +++ b/docs/make-db.rst @@ -67,6 +67,8 @@ scripts, so to install the schema we merely run all the scripts:: If you check the DB again you should see a good amount of tables. +.. _make-user: + Create Admin User in DB ----------------------- diff --git a/docs/run-webapp.rst b/docs/run-webapp.rst new file mode 100644 index 0000000..42c0f9b --- /dev/null +++ b/docs/run-webapp.rst @@ -0,0 +1,77 @@ + +.. highlight:: sh + +Run the Web App +=============== + +At this point we assume you already have a project installed to your +virtualenv, and have done basic configuration as well as established your app +database. + + +Make/Edit Config +---------------- + +If you've been following along with this tutorial you may have already done +this step, but in any case we'll revisit now. + +If you do *not* yet have a file at e.g. ``/srv/envs/rattut/app/web.conf`` then +you should now run:: + + cdvirtualenv app + rattail make-config -T web + +Then you must edit the generated file, looking for TODO notes and such, and +generally tweaking things to your liking. + + +Start the Web App +----------------- + +The web app is effectively a daemon, in that it's meant to be a long-running +process which continues to listen for and respond to incoming requests. + +In production, this may be wired up in various ways, but for now we're only +concerned with development, where we'll be starting the web app "server" from +command line:: + + cdvirtualenv + bin/pserve --reload file+ini:app/web.conf + +Note that this command will "block" - meaning control will not immediately fall +back to your shell prompt. You may use Ctrl+C whenever you like, to kill the +web app. + + +Browse the Web App +------------------ + +This will only work when the above ``pserve`` command is running, but assuming +it is currently, you can access the web app at http://localhost:9080/ + +Note that the default ``web.conf`` specifies 9080 as the port on which the web +app will listen. You can modify this as needed, but if you do, and are also +using Vagrant, you may also need to modify your ``Vagrantfile`` (and do a +``vagrant reload``). + + +Login to Web App +---------------- + +If you've been following along with the tutorial then you probably have already +created an admin account for yourself. But in case you haven't, please see +:ref:`make-user`. + +Once that's set then you should be able to login to the web app with those same +credentials. + +The very first thing you see is likely "not much" - most of the menu will be +hidden to you, since by default you do not have sufficient permissions to +access the features they represent. + +However you are an "admin" user - which really just means your user account +belongs to the special "Administrators" role. This role is special in that +anyone who belongs to it, is given an extra "Become Root" option in the menu. +This works similarly to the Linux "root" concept, in that if you become root, +you will be implicitly granted *all* permissions and nothing will be hidden +from you. This lasts until you "stop being root" or logout. From 088fd4a6a5faa48a10769f7f3b307c00a50838f7 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 17 Aug 2019 19:03:21 -0500 Subject: [PATCH 05/18] Remove unwanted web template overrides those are no longer needed these days --- rattail_tutorial/web/templates/home.mako | 14 -------------- rattail_tutorial/web/templates/login.mako | 18 ------------------ 2 files changed, 32 deletions(-) delete mode 100644 rattail_tutorial/web/templates/home.mako delete mode 100644 rattail_tutorial/web/templates/login.mako diff --git a/rattail_tutorial/web/templates/home.mako b/rattail_tutorial/web/templates/home.mako deleted file mode 100644 index 51360f4..0000000 --- a/rattail_tutorial/web/templates/home.mako +++ /dev/null @@ -1,14 +0,0 @@ -## -*- coding: utf-8; mode: html; -*- -<%inherit file="tailbone:templates/home.mako" /> - -<%def name="title()">Home - - - -

Welcome to Rattail Tutorial

- diff --git a/rattail_tutorial/web/templates/login.mako b/rattail_tutorial/web/templates/login.mako deleted file mode 100644 index 786e149..0000000 --- a/rattail_tutorial/web/templates/login.mako +++ /dev/null @@ -1,18 +0,0 @@ -## -*- coding: utf-8; mode: html; -*- -<%inherit file="tailbone:templates/login.mako" /> - -<%def name="extra_styles()"> - ${parent.extra_styles()} - - - -<%def name="logo()"> - ## ${h.image(request.static_url('ratbob.web:static/img/ratbob.jpg'), "Ratbob Logo", id='logo', width=500)} - ${h.image(request.static_url('tailbone:static/img/home_logo.png'), "Rattail Logo", id='logo')} - - -${parent.body()} From 95e89a6081c5705f3d6408b38ade63770b13c663 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 20 Aug 2019 12:24:16 -0500 Subject: [PATCH 06/18] Start docs for customizing the app (not much here yet, but will grow over time...) --- docs/customize/disable-web-view.rst | 89 ++++++++++++++++++++++++++ docs/customize/index.rst | 22 +++++++ docs/index.rst | 1 + rattail_tutorial/web/views/__init__.py | 1 - 4 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 docs/customize/disable-web-view.rst create mode 100644 docs/customize/index.rst diff --git a/docs/customize/disable-web-view.rst b/docs/customize/disable-web-view.rst new file mode 100644 index 0000000..8e1cc0e --- /dev/null +++ b/docs/customize/disable-web-view.rst @@ -0,0 +1,89 @@ + +Hide / Disable Unwanted Web Views +================================= + +The first thing we'll want to do is take stock of the views currently exposed +by the web app, and either hide or outright "remove" any we don't want (yet). + +There are sort of 3 different aspects to whether or not a particular web view +is "available" for a given user: + +* is the view even defined? +* does user have permission to access the view? +* is there a menu (or other) link to the view? + +Removing a (Master) View +------------------------ + +There are a few "core" web views which will "always" be defined, but the vast +majority are really optional. The so-called "master" web views, each of which +basically corresponds to a particular table in the DB, are (almost?) entirely +optional. For instance if your organization needs to track customers but not +products, within your Poser app, then you might go so far as to "remove" the +product views from your app. + +If you do this, then e.g. navigating to http://localhost:9080/products/ (or +whatever your URL is) would result in a 404 not found error regardless of user +permissions, i.e. even if you "become root". However by default (using code +generated via scaffold) the product views *are* enabled, so this URL *would* +work. + +Whether or not a given view(s) is "defined" will depend on whether or not the +module containing this view(s) has been "included" by the Pyramid (web app) +Configurator object. In other words we're leveraging this "include" concept +from `Pyramid`_ in order to control which views are brought into the running +app. + +.. _Pyramid: https://trypyramid.com/ + +In practice what that means is usually just that you must curate the list of +views which are included, within your own project. This config thing works +recursively, but we try to keep the primary list within a conventional place. +In our (tutorial's) case this file is at +``~/src/rattail-tutorial/rattail_tutorial/web/views/__init__.py`` and by +default (freshly generated via scaffold) it looks something like this:: + + def includeme(config): + + # core views + config.include('rattail_tutorial.web.views.common') + config.include('tailbone.views.auth') + config.include('tailbone.views.tables') + config.include('tailbone.views.upgrades') + config.include('tailbone.views.progress') + + # main table views + config.include('tailbone.views.brands') + config.include('tailbone.views.customers') + config.include('tailbone.views.customergroups') + config.include('tailbone.views.datasync') + config.include('tailbone.views.departments') + config.include('tailbone.views.email') + config.include('tailbone.views.employees') + config.include('tailbone.views.messages') + config.include('tailbone.views.people') + config.include('tailbone.views.products') + config.include('tailbone.views.reportcodes') + config.include('tailbone.views.roles') + config.include('tailbone.views.settings') + config.include('tailbone.views.shifts') + config.include('tailbone.views.stores') + config.include('tailbone.views.subdepartments') + config.include('tailbone.views.users') + config.include('tailbone.views.vendors') + + # batch views + config.include('tailbone.views.handheld') + config.include('tailbone.views.inventory') + +In our case the only thing we'll remove for now is the "shifts" entry, i.e. we +wish to remove the line that says:: + + config.include('tailbone.views.shifts') + +That's because these views have to do with staff scheduling and time clock +stuff, which (at least for now) we won't concern ourselves with. + +Note that the underlying *tables* which might contain such data, are left in +place within our database. We're just declaring that we do not need our web +app to support master views for interacting with those tables. diff --git a/docs/customize/index.rst b/docs/customize/index.rst new file mode 100644 index 0000000..8986d22 --- /dev/null +++ b/docs/customize/index.rst @@ -0,0 +1,22 @@ + +Customizing the App! +==================== + +Now that you've made it through the "setup" gauntlet, it's finally time for +some fun stuff. + +As we're building this tutorial, at this point our project is *basically* the +same as any other "Poser" project, as generated via scaffold. But as we keep +going, our project will become more and more customized for the purposes of the +tutorial. + +So if you have just created a new project, some of this might make more sense +to you, vs. if you're running the rattail-tutorial project itself, many things +described in this section will have already been done (and then some) to the +code base, so you should keep that in mind when reading. + + +.. toctree:: + :maxdepth: 2 + + disable-web-view diff --git a/docs/index.rst b/docs/index.rst index 71020c9..a434455 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -58,6 +58,7 @@ Table of Contents pkg-release make-db run-webapp + customize/index Indices and tables diff --git a/rattail_tutorial/web/views/__init__.py b/rattail_tutorial/web/views/__init__.py index f56118a..74d7029 100644 --- a/rattail_tutorial/web/views/__init__.py +++ b/rattail_tutorial/web/views/__init__.py @@ -48,7 +48,6 @@ def includeme(config): config.include('tailbone.views.reportcodes') config.include('tailbone.views.roles') config.include('tailbone.views.settings') - config.include('tailbone.views.shifts') config.include('tailbone.views.stores') config.include('tailbone.views.subdepartments') config.include('tailbone.views.users') From 3af49e2e624c98d6cea54e6770c12f79fdfe19b7 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:03:11 -0500 Subject: [PATCH 07/18] feat: switch from setup.cfg to pyproject.toml + hatchling --- .gitignore | 3 + pyproject.toml | 60 ++++++++++++++++++ rattail_tutorial/_version.py | 5 +- setup.py | 118 ----------------------------------- tasks.py | 13 ++-- 5 files changed, 71 insertions(+), 128 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index da46463..2593080 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +*~ +*.pyc +dist/ rattail_tutorial.egg-info/ docs/_build/ .tox/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4d7db08 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + + +[project] +name = "rattail-tutorial" +version = "0.1.0" +description = "Rattail Development Tutorial" +readme = "README.rst" +authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] +license = {text = "GNU GPL v3+"} +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Environment :: Web Environment", + "Framework :: Pyramid", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Office/Business", +] +dependencies = [ + "invoke", + "psycopg2", + "rattail[auth,db,bouncer]", + "Tailbone", + "tox", +] + + +[project.scripts] +rattail_tutorial = "rattail_tutorial.commands:main" + + +[project.entry-points."paste.app_factory"] +main = "rattail_tutorial.web.app:main" + + +[project.entry-points."rattail.config.extensions"] +rattail_tutorial = "rattail_tutorial.config:Rattail_tutorialConfig" + + +[project.entry-points."rattail_tutorial.subcommands"] +hello = "rattail_tutorial.commands:HelloWorld" + + +[project.urls] +Homepage = "https://rattailproject.org" +repository = "https://kallithea.rattailproject.org/rattail-project/rattail-tutorial" +Changelog = "https://kallithea.rattailproject.org/rattail-project/rattail-tutorial/files/master/CHANGELOG.md" + + +[tool.commitizen] +version_provider = "pep621" +tag_format = "v$version" +update_changelog_on_bump = true diff --git a/rattail_tutorial/_version.py b/rattail_tutorial/_version.py index e41b669..fcfc0bd 100644 --- a/rattail_tutorial/_version.py +++ b/rattail_tutorial/_version.py @@ -1,3 +1,6 @@ # -*- coding: utf-8; -*- -__version__ = '0.1.0' +from importlib.metadata import version + + +__version__ = version('rattail-tutorial') diff --git a/setup.py b/setup.py deleted file mode 100644 index bcb5e8e..0000000 --- a/setup.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8; -*- -################################################################################ -# -# Rattail -- Retail Software Framework -# Copyright © 2010-2019 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 . -# -################################################################################ -""" -Rattail Tutorial setup script -""" - -import os -from setuptools import setup, find_packages - - -here = os.path.abspath(os.path.dirname(__file__)) -exec(open(os.path.join(here, 'rattail_tutorial', '_version.py')).read()) -README = open(os.path.join(here, 'README.rst')).read() - - -requires = [ - # - # Version numbers within comments below have specific meanings. - # Basically the 'low' value is a "soft low," and 'high' a "soft high." - # In other words: - # - # If either a 'low' or 'high' value exists, the primary point to be - # made about the value is that it represents the most current (stable) - # version available for the package (assuming typical public access - # methods) whenever this project was started and/or documented. - # Therefore: - # - # If a 'low' version is present, you should know that attempts to use - # versions of the package significantly older than the 'low' version - # may not yield happy results. (A "hard" high limit may or may not be - # indicated by a true version requirement.) - # - # Similarly, if a 'high' version is present, and especially if this - # project has laid dormant for a while, you may need to refactor a bit - # when attempting to support a more recent version of the package. (A - # "hard" low limit should be indicated by a true version requirement - # when a 'high' version is present.) - # - # In any case, developers and other users are encouraged to play - # outside the lines with regard to these soft limits. If bugs are - # encountered then they should be filed as such. - # - # package # low high - - 'invoke', # 1.3.0 - 'psycopg2', # 2.6.2 - 'rattail[auth,db,bouncer]', # 0.7.25 - 'Tailbone', # 0.5.29 - 'tox', # 3.13.2 -] - - -setup( - name = "rattail-tutorial", - version = __version__, - author = "Lance Edgar", - author_email = "lance@edbob.org", - url = "https://rattailproject.org", - license = "GNU GPL v3", - description = "Rattail Development Tutorial", - long_description = README, - - classifiers = [ - 'Development Status :: 3 - Alpha', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Framework :: Pyramid', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: Office/Business', - ], - - install_requires = requires, - packages = find_packages(), - include_package_data = True, - - entry_points = { - - 'rattail.config.extensions': [ - 'rattail_tutorial = rattail_tutorial.config:Rattail_tutorialConfig', - ], - - 'console_scripts': [ - 'rattail_tutorial = rattail_tutorial.commands:main', - ], - - 'rattail_tutorial.commands': [ - 'hello = rattail_tutorial.commands:HelloWorld', - ], - - 'paste.app_factory': [ - 'main = rattail_tutorial.web.app:main', - ], - }, -) diff --git a/tasks.py b/tasks.py index f542632..f493ceb 100644 --- a/tasks.py +++ b/tasks.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -24,20 +24,15 @@ Tasks for 'rattail-tutorial' package """ -import os - from invoke import task -here = os.path.abspath(os.path.dirname(__file__)) -exec(open(os.path.join(here, 'rattail_tutorial', '_version.py')).read()) - - @task def release(c): """ Release a new version of `rattail-tutorial`. """ c.run('rm -rf rattail_tutorial.egg-info') - c.run('python setup.py sdist --formats=gztar') - c.run('twine upload dist/rattail-tutorial-{}.tar.gz'.format(__version__)) + c.run('rm -rf dist') + c.run('python -m build --sdist') + c.run('twine upload dist/*') From 43a6c568440ddd8c923d7e93bd09ce6121dcffff Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:03:21 -0500 Subject: [PATCH 08/18] =?UTF-8?q?bump:=20version=200.1.0=20=E2=86=92=200.2?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f908fda..0d138f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to rattail-tutorial will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project (probably doesn't) adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.2.0 (2024-07-01) + +### Feat + +- switch from setup.cfg to pyproject.toml + hatchling + ## [0.1.0] - 2019-08-15 ### Changed - Initial version, with very basic (mostly generated) app. diff --git a/pyproject.toml b/pyproject.toml index 4d7db08..7566730 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "rattail-tutorial" -version = "0.1.0" +version = "0.2.0" description = "Rattail Development Tutorial" readme = "README.rst" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] From 4588fb817989edb75ee4f1f89b38b8ea97727084 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:09:44 -0500 Subject: [PATCH 09/18] use furo docs theme instead of alabaster --- docs/conf.py | 8 +++++--- pyproject.toml | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 50aaca2..eb80bf5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,12 +17,14 @@ # -- Project information ----------------------------------------------------- +from importlib.metadata import version as get_version + project = 'rattail-tutorial' -copyright = '2019, Lance Edgar' +copyright = '2019-2024, Lance Edgar' author = 'Lance Edgar' # The full version, including alpha/beta/rc tags -release = '0.1' +release = get_version('rattail-tutorial') # -- General configuration --------------------------------------------------- @@ -51,7 +53,7 @@ todo_include_todos = True # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'furo' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/pyproject.toml b/pyproject.toml index 7566730..f2524b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,11 @@ classifiers = [ "Topic :: Office/Business", ] dependencies = [ + "furo", "invoke", "psycopg2", "rattail[auth,db,bouncer]", + "Sphinx", "Tailbone", "tox", ] From 4c9c321608d31e037f234aa2f845d4a838e434c6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:21:34 -0500 Subject: [PATCH 10/18] feat: migrate all commands to use `typer` framework --- pyproject.toml | 4 ++-- rattail_tutorial/commands.py | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f2524b2..6f7184c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "furo", "invoke", "psycopg2", - "rattail[auth,db,bouncer]", + "rattail[db,bouncer]", "Sphinx", "Tailbone", "tox", @@ -35,7 +35,7 @@ dependencies = [ [project.scripts] -rattail_tutorial = "rattail_tutorial.commands:main" +rattail_tutorial = "rattail_tutorial.commands:rattail_tutorial_typer" [project.entry-points."paste.app_factory"] diff --git a/rattail_tutorial/commands.py b/rattail_tutorial/commands.py index 78e2dd5..6bca8f8 100644 --- a/rattail_tutorial/commands.py +++ b/rattail_tutorial/commands.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -26,11 +26,29 @@ Rattail Tutorial commands import sys -from rattail import commands +import typer +from rattail import commands +from rattail.commands.typer import make_typer from rattail_tutorial import __version__ +rattail_tutorial_typer = make_typer( + name='rattail_tutorial', + help="Rattail Tutorial (custom Rattail system)" +) + + +@rattail_tutorial_typer.command() +def hello( + ctx: typer.Context, +): + """ + The requisite 'hello world' example + """ + sys.stdout.write("hello world!\n") + + def main(*args): """ Main entry point for Rattail Tutorial command system From 1c14ad72cdca8889a7ba1e700f7f4668de3d9c16 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:22:57 -0500 Subject: [PATCH 11/18] =?UTF-8?q?bump:=20version=200.2.0=20=E2=86=92=200.3?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d138f3..d5a93c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to rattail-tutorial will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project (probably doesn't) adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.3.0 (2024-07-01) + +### Feat + +- migrate all commands to use `typer` framework + ## v0.2.0 (2024-07-01) ### Feat diff --git a/pyproject.toml b/pyproject.toml index 6f7184c..93c6a4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "rattail-tutorial" -version = "0.2.0" +version = "0.3.0" description = "Rattail Development Tutorial" readme = "README.rst" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] From ab12cba1d5591f52748738176b63e1c86531b82b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:45:41 -0500 Subject: [PATCH 12/18] fix: remove legacy command definitions --- pyproject.toml | 4 ---- rattail_tutorial/commands.py | 32 -------------------------------- 2 files changed, 36 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 93c6a4b..a50184a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,10 +46,6 @@ main = "rattail_tutorial.web.app:main" rattail_tutorial = "rattail_tutorial.config:Rattail_tutorialConfig" -[project.entry-points."rattail_tutorial.subcommands"] -hello = "rattail_tutorial.commands:HelloWorld" - - [project.urls] Homepage = "https://rattailproject.org" repository = "https://kallithea.rattailproject.org/rattail-project/rattail-tutorial" diff --git a/rattail_tutorial/commands.py b/rattail_tutorial/commands.py index 6bca8f8..87c50f9 100644 --- a/rattail_tutorial/commands.py +++ b/rattail_tutorial/commands.py @@ -28,9 +28,7 @@ import sys import typer -from rattail import commands from rattail.commands.typer import make_typer -from rattail_tutorial import __version__ rattail_tutorial_typer = make_typer( @@ -47,33 +45,3 @@ def hello( The requisite 'hello world' example """ sys.stdout.write("hello world!\n") - - -def main(*args): - """ - Main entry point for Rattail Tutorial command system - """ - args = list(args or sys.argv[1:]) - cmd = Command() - cmd.run(*args) - - -class Command(commands.Command): - """ - Main command for Rattail Tutorial - """ - name = 'rattail_tutorial' - version = __version__ - description = "Rattail Tutorial (custom Rattail system)" - long_description = '' - - -class HelloWorld(commands.Subcommand): - """ - The requisite 'hello world' example - """ - name = 'hello' - description = __doc__.strip() - - def run(self, args): - self.stdout.write("hello world!\n") From f0dc65ee0833ba22a192415b5a059f5703fed866 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 11:46:10 -0500 Subject: [PATCH 13/18] =?UTF-8?q?bump:=20version=200.3.0=20=E2=86=92=200.3?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a93c8..8b57c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to rattail-tutorial will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project (probably doesn't) adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.3.1 (2024-07-01) + +### Fix + +- remove legacy command definitions + ## v0.3.0 (2024-07-01) ### Feat diff --git a/pyproject.toml b/pyproject.toml index a50184a..52aae87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "rattail-tutorial" -version = "0.3.0" +version = "0.3.1" description = "Rattail Development Tutorial" readme = "README.rst" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] From 95f8ae318a00be95d6414bcb12ea7fe12f835edf Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 13:25:31 -0500 Subject: [PATCH 14/18] fix: refactor custom menu builder, to inherit some menus also rename config extension, per conventions --- pyproject.toml | 2 +- rattail_tutorial/config.py | 8 +- rattail_tutorial/web/menus.py | 147 ++++++++++++++-------------------- 3 files changed, 65 insertions(+), 92 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 52aae87..9a33e70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ main = "rattail_tutorial.web.app:main" [project.entry-points."rattail.config.extensions"] -rattail_tutorial = "rattail_tutorial.config:Rattail_tutorialConfig" +rattail_tutorial = "rattail_tutorial.config:RattailTutorialConfig" [project.urls] diff --git a/rattail_tutorial/config.py b/rattail_tutorial/config.py index 1415ea1..eeb6944 100644 --- a/rattail_tutorial/config.py +++ b/rattail_tutorial/config.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -27,7 +27,7 @@ Custom config from rattail.config import ConfigExtension -class Rattail_tutorialConfig(ConfigExtension): +class RattailTutorialConfig(ConfigExtension): """ Rattail config extension for Rattail Tutorial """ @@ -36,5 +36,5 @@ class Rattail_tutorialConfig(ConfigExtension): def configure(self, config): # set some default config values - config.setdefault('rattail.mail', 'emails', 'rattail_tutorial.emails') - config.setdefault('tailbone', 'menus', 'rattail_tutorial.web.menus') + config.setdefault('rattail.mail.emails', 'rattail_tutorial.emails') + config.setdefault('tailbone.menus.handler', 'rattail_tutorial.web.menus:TutorialMenuHandler') diff --git a/rattail_tutorial/web/menus.py b/rattail_tutorial/web/menus.py index b9b6d40..402ca8a 100644 --- a/rattail_tutorial/web/menus.py +++ b/rattail_tutorial/web/menus.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -24,166 +24,139 @@ Web Menus """ +from tailbone import menus as base -def simple_menus(request): - url = request.route_url - menus = [ - { +class TutorialMenuHandler(base.MenuHandler): + """ + Demo menu handler + """ + + def make_menus(self, request, **kwargs): + + products_menu = self.make_products_menu(request) + + vendors_menu = self.make_vendors_menu(request) + + company_menu = self.make_company_menu(request) + + batches_menu = self.make_batches_menu(request) + + admin_menu = self.make_admin_menu(request, + include_stores=False, + include_tenders=False) + + menus = [ + products_menu, + vendors_menu, + company_menu, + batches_menu, + admin_menu, + ] + + return menus + + def make_products_menu(self, request, **kwargs): + return { 'title': "Products", 'type': 'menu', 'items': [ { 'title': "Products", - 'url': url('products'), + 'route': 'products', 'perm': 'products.list', }, { 'title': "Brands", - 'url': url('brands'), + 'route': 'brands', 'perm': 'brands.list', }, { 'title': "Report Codes", - 'url': url('reportcodes'), + 'route': 'reportcodes', 'perm': 'reportcodes.list', }, ], - }, - { + } + + def make_vendors_menu(self, request, **kwargs): + return { 'title': "Vendors", 'type': 'menu', 'items': [ { 'title': "Vendors", - 'url': url('vendors'), + 'route': 'vendors', 'perm': 'vendors.list', }, {'type': 'sep'}, { 'title': "Catalogs", - 'url': url('vendorcatalogs'), + 'route': 'vendorcatalogs', 'perm': 'vendorcatalogs.list', }, { 'title': "Upload New Catalog", - 'url': url('vendorcatalogs.create'), + 'route': 'vendorcatalogs.create', 'perm': 'vendorcatalogs.create', }, ], - }, - { + } + + def make_company_menu(self, request, **kwargs): + return { 'title': "Company", 'type': 'menu', 'items': [ { 'title': "Stores", - 'url': url('stores'), + 'route': 'stores', 'perm': 'stores.list', }, { 'title': "Departments", - 'url': url('departments'), + 'route': 'departments', 'perm': 'departments.list', }, { 'title': "Subdepartments", - 'url': url('subdepartments'), + 'route': 'subdepartments', 'perm': 'subdepartments.list', }, {'type': 'sep'}, { 'title': "Employees", - 'url': url('employees'), + 'route': 'employees', 'perm': 'employees.list', }, {'type': 'sep'}, { 'title': "Customers", - 'url': url('customers'), + 'route': 'customers', 'perm': 'customers.list', }, { 'title': "Customer Groups", - 'url': url('customergroups'), + 'route': 'customergroups', 'perm': 'customergroups.list', }, ], - }, - { + } + + def make_batches_menu(self, request, **kwargs): + return { 'title': "Batches", 'type': 'menu', 'items': [ { 'title': "Handheld", - 'url': url('batch.handheld'), + 'route': 'batch.handheld', 'perm': 'batch.handheld.list', }, { 'title': "Inventory", - 'url': url('batch.inventory'), + 'route': 'batch.inventory', 'perm': 'batch.inventory.list', }, ], - }, - { - 'title': "Admin", - 'type': 'menu', - 'items': [ - { - 'title': "Users", - 'url': url('users'), - 'perm': 'users.list', - }, - { - 'title': "User Events", - 'url': url('userevents'), - 'perm': 'userevents.list', - }, - { - 'title': "Roles", - 'url': url('roles'), - 'perm': 'roles.list', - }, - {'type': 'sep'}, - { - 'title': "App Settings", - 'url': url('appsettings'), - 'perm': 'settings.list', - }, - { - 'title': "Email Settings", - 'url': url('emailprofiles'), - 'perm': 'emailprofiles.list', - }, - { - 'title': "Email Attempts", - 'url': url('email_attempts'), - 'perm': 'email_attempts.list', - }, - { - 'title': "Raw Settings", - 'url': url('settings'), - 'perm': 'settings.list', - }, - {'type': 'sep'}, - { - 'title': "DataSync Changes", - 'url': url('datasyncchanges'), - 'perm': 'datasync.list', - }, - { - 'title': "Tables", - 'url': url('tables'), - 'perm': 'tables.list', - }, - { - 'title': "Rattail Tutorial Upgrades", - 'url': url('upgrades'), - 'perm': 'upgrades.list', - }, - ], - }, - ] - - return menus + } From 1fb3ee10d05410c98e5778e00ff836c3b2b2a38a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 9 Jul 2024 10:16:31 -0500 Subject: [PATCH 15/18] fix: update config for custom emails per upstream changes --- pyproject.toml | 4 ++++ rattail_tutorial/config.py | 1 - rattail_tutorial/emails.py | 5 +---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9a33e70..1beb55c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,10 @@ main = "rattail_tutorial.web.app:main" rattail_tutorial = "rattail_tutorial.config:RattailTutorialConfig" +[project.entry-points."rattail.emails"] +rattail_tutorial = "rattail_tutorial.emails" + + [project.urls] Homepage = "https://rattailproject.org" repository = "https://kallithea.rattailproject.org/rattail-project/rattail-tutorial" diff --git a/rattail_tutorial/config.py b/rattail_tutorial/config.py index eeb6944..12798ec 100644 --- a/rattail_tutorial/config.py +++ b/rattail_tutorial/config.py @@ -36,5 +36,4 @@ class RattailTutorialConfig(ConfigExtension): def configure(self, config): # set some default config values - config.setdefault('rattail.mail.emails', 'rattail_tutorial.emails') config.setdefault('tailbone.menus.handler', 'rattail_tutorial.web.menus:TutorialMenuHandler') diff --git a/rattail_tutorial/emails.py b/rattail_tutorial/emails.py index 1e82c6a..4359049 100644 --- a/rattail_tutorial/emails.py +++ b/rattail_tutorial/emails.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -26,9 +26,6 @@ Custom email profiles from rattail.mail import Email -# bring in some common ones from rattail -from rattail.emails import datasync_error_watcher_get_changes, filemon_action_error - class rattail_import_sample_updates(Email): """ From b96c828fa3461aaffb166aa0be2ff3898ac75970 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 16 Aug 2024 13:34:48 -0500 Subject: [PATCH 16/18] fix: avoid deprecated base class for config extension --- rattail_tutorial/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rattail_tutorial/config.py b/rattail_tutorial/config.py index 12798ec..5b54e1f 100644 --- a/rattail_tutorial/config.py +++ b/rattail_tutorial/config.py @@ -24,10 +24,10 @@ Custom config """ -from rattail.config import ConfigExtension +from wuttjamaican.conf import WuttaConfigExtension -class RattailTutorialConfig(ConfigExtension): +class RattailTutorialConfig(WuttaConfigExtension): """ Rattail config extension for Rattail Tutorial """ From 70b103ebd84fc5afb5ec93ebda14a72c41fdf1d0 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 13 Sep 2024 18:21:24 -0500 Subject: [PATCH 17/18] docs: use markdown for readme file --- README.rst => README.md | 8 ++------ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) rename README.rst => README.md (59%) diff --git a/README.rst b/README.md similarity index 59% rename from README.rst rename to README.md index 1d15628..d8b38c1 100644 --- a/README.rst +++ b/README.md @@ -1,13 +1,9 @@ -.. -*- mode: rst -*- -rattail-tutorial -================ +# rattail-tutorial This project is intended for use as a "tutorial" for Rattail app development. It contains documentation for the tutorial itself, but also contains code for the tutorial app, which users may run locally for testing. -See the `Rattail website`_ for more info. - -.. _`Rattail website`: https://rattailproject.org/ +See the [Rattail website](https://rattailproject.org/) for more info. diff --git a/pyproject.toml b/pyproject.toml index 1beb55c..f70a108 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "hatchling.build" name = "rattail-tutorial" version = "0.3.1" description = "Rattail Development Tutorial" -readme = "README.rst" +readme = "README.md" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] license = {text = "GNU GPL v3+"} classifiers = [ From 06394dc3e3e7f2179e4ec5e76d63c2a8ce12e178 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 14 Sep 2024 10:47:30 -0500 Subject: [PATCH 18/18] docs: update project links, kallithea -> forgejo --- docs/create-project.rst | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/create-project.rst b/docs/create-project.rst index 4c6932a..9cb84ec 100644 --- a/docs/create-project.rst +++ b/docs/create-project.rst @@ -125,7 +125,7 @@ rattail-tutorial app instead, you should do this:: mkdir -p ~/src cd ~/src - git clone https://rattailproject.org/git/rattail-tutorial.git + git clone https://forgejo.wuttaproject.org/rattail/rattail-tutorial.git pip install -e rattail-tutorial Creating the Project diff --git a/pyproject.toml b/pyproject.toml index f70a108..f2c9f05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,8 +52,8 @@ rattail_tutorial = "rattail_tutorial.emails" [project.urls] Homepage = "https://rattailproject.org" -repository = "https://kallithea.rattailproject.org/rattail-project/rattail-tutorial" -Changelog = "https://kallithea.rattailproject.org/rattail-project/rattail-tutorial/files/master/CHANGELOG.md" +repository = "https://forgejo.wuttaproject.org/rattail/rattail-tutorial" +Changelog = "https://forgejo.wuttaproject.org/rattail/rattail-tutorial/src/branch/master/CHANGELOG.md" [tool.commitizen]