Skip to content

Commit

Permalink
2023.3.25 update
Browse files Browse the repository at this point in the history
  • Loading branch information
HubTou committed Mar 25, 2023
1 parent 75bf0c4 commit 661b5cb
Show file tree
Hide file tree
Showing 29 changed files with 2,041 additions and 78 deletions.
1 change: 1 addition & 0 deletions _demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ You can also check our [echobox](https://github.com/HubTou/PNU/tree/main/_demos/
Beyond that point, the handy [Python Standard Library](https://docs.python.org/3/library/index.html) online documentation and the online book [Automate the Boring Stuff with Python](https://automatetheboringstuff.com/) could also be useful to progress quickly.

[RTFM](http://www.catb.org/jargon/html/R/RTFM.html)! as they say.

1 change: 1 addition & 0 deletions _demos/gorgon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@ There will be other [easter eggs](http://www.catb.org/jargon/html/E/Easter-egg.h
On the lore side, it's interesting to note that the Demogorgon was one of the monsters of the [classical](http://www.catb.org/jargon/html/N/nethack.html) [NetHack](https://en.wikipedia.org/wiki/NetHack) game, which itself was a descendant of the [mythical](http://www.catb.org/jargon/html/R/rogue.html) [Rogue](https://en.wikipedia.org/wiki/Rogue_(video_game)) and [Hack](https://en.wikipedia.org/wiki/Hack_(video_game)) games, which were included in [BSD](http://www.catb.org/jargon/html/B/BSD.html) Unix and many other versions after that.

Perhaps someone will reimplement these important milestones in video gaming history for the project?

1 change: 1 addition & 0 deletions _demos/hello_world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ You can do that with the [vermin package](https://pypi.org/project/vermin/):
Minimum required versions: 2.0, 3.0
```
That will be useful when we'll talk about [making installation packages](https://packaging.python.org/tutorials/packaging-projects/) later.

1 change: 1 addition & 0 deletions _demos/logging1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ Using the [vermin package](https://pypi.org/project/vermin/):
# vermin logging1.py
Minimum required versions: 2.4, 3.0
```

1 change: 1 addition & 0 deletions _images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ File|Size|preview
---|---|---
pnu-logo-and-title-small.png|244x113 pixels|![PNU logo](https://github.com/HubTou/PNU/blob/main/_images/pnu-logo-and-title-small.png)
pnu-logo-and-title.png|1280x640 pixels|![PNU logo](https://github.com/HubTou/PNU/blob/main/_images/pnu-logo-and-title-small.png)

2 changes: 1 addition & 1 deletion _template/License
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021+ YOU
Copyright 2023+ YOU

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand Down
26 changes: 20 additions & 6 deletions _template/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME=COMMAND
SECTION=1
SOURCES=src/${NAME}/__init__.py src/${NAME}/main.py
# Add your other source files on the following line:
SOURCES=src/${NAME}/__init__.py src/${NAME}/main.py # src/${NAME}/library.py

# Default action is to show this help message:
.help:
Expand Down Expand Up @@ -44,10 +44,24 @@ format: /usr/local/bin/black
love:
@echo "Not war!"

man/${NAME}.${SECTION}.gz: man/${NAME}.${SECTION}
@gzip -k9c man/${NAME}.${SECTION} > man/${NAME}.${SECTION}.gz
man/${NAME}.1.gz: man/${NAME}.1
@gzip -k9c man/${NAME}.1 > man/${NAME}.1.gz

package: man/${NAME}.${SECTION}.gz
# Uncomment the next comment if you offer a library interface

#man/${NAME}.3.gz: man/${NAME}.3
# @gzip -k9c man/${NAME}.3 > man/${NAME}.3.gz

# Uncomment the commented parts in the next targets
# if you have an internationalized application:

#src/${NAME}/po/en/${NAME}.mo:
# @msgfmt --output-file=src/${NAME}/po/en/${NAME}.mo src/${NAME}/po/en/${NAME}.po

#src/${NAME}/po/fr/${NAME}.mo:
# @msgfmt --output-file=src/${NAME}/po/fr/${NAME}.mo src/${NAME}/po/fr/${NAME}.po

package: man/${NAME}.1.gz # man/${NAME}.3.gz src/${NAME}/po/en/${NAME}.mo src/${NAME}/po/fr/${NAME}.mo
python -m build

upload-test:
Expand All @@ -57,5 +71,5 @@ upload:
python -m twine upload dist/*

distclean:
rm -rf build dist man/${NAME}.${SECTION}.gz src/*.egg-info
rm -rf build dist src/*.egg-info man/${NAME}.1.gz # man/${NAME}.3.gz src/${NAME}/po/en/${NAME}.mo src/${NAME}/po/fr/${NAME}.mo

25 changes: 23 additions & 2 deletions _template/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Installation
pip install [pnu-COMMAND](https://pypi.org/project/pnu-COMMAND/)
Once you have installed [Python](https://www.python.org/downloads/) and its packages manager [pip](https://pip.pypa.io/en/stable/installation/),
use one of the following commands, depending on if you want only this tool, the full set of PNU tools, or PNU plus a selection of additional third-parties tools:

```
pip install COMMAND
pip install PNU
pip install pytnix
```

# COMMAND(1)

Expand All @@ -25,7 +32,17 @@ Options | Use
--|Options processing terminator

## ENVIRONMENT
The COMMAND_DEBUG environment variable can also be set to any value to enable debug mode.
The COMMAND_DEBUG environment variable can be set to any value to enable debug mode.

The *FLAVOUR* or *COMMAND_FLAVOUR* environment variables can be set to one of the following values, to implement only the corresponding options and behaviours:
* posix : POSIX [COMMAND](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/COMMAND.html)
* unix | unix:v10 : Unix v10 [COMMAND(1)](http://man.cat-v.org/unix_10th/1/COMMAND)
* bsd | bsd:freebsd : FreeBSD [COMMAND(1)](https://www.freebsd.org/cgi/man.cgi?query=COMMAND)
* gnu | gnu:linux | linux : GNU/Linux [COMMAND(1)](https://man7.org/linux/man-pages/man1/COMMAND.1.html)
* plan9 : Plan 9 [COMMAND(1)](http://man.cat-v.org/plan_9/1/COMMAND)
* inferno : Inferno [COMMAND(1)](http://man.cat-v.org/inferno/1/COMMAND)

However, if the *POSIXLY_CORRECT* environment variable is set to any value, then the POSIX flavour will be selected.

## FILES

Expand All @@ -35,6 +52,8 @@ The **COMMAND** utility exits 0 on success, and >0 if an error occurs.
## EXAMPLES

## SEE ALSO
[OTHER_CMD(1)](https://www.freebsd.org/cgi/man.cgi?query=OTHER_CMD),
[OTHER_CMD_2(1)](https://www.freebsd.org/cgi/man.cgi?query=OTHER_CMD_2)

## STANDARDS
The **COMMAND** utility is a standard UNIX/POSIX command.
Expand All @@ -56,6 +75,8 @@ It is available under the [3-clause BSD license](https://opensource.org/licenses
## AUTHORS
[YOU](https://github.com/YOU)

This manual page is mainly based on the one written for [FreeBSD](https://www.freebsd.org/) by [HIM](https://github.com/HIM).

## CAVEATS

## BUGS
Expand Down
30 changes: 29 additions & 1 deletion _template/man/COMMAND.1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,31 @@ Options processing terminator
.Sh ENVIRONMENT
The
.Ev COMMAND_DEBUG
environment variable can also be set to any value to enable debug mode.
environment variable can be set to any value to enable debug mode.
.Pp
The
.Ev FLAVOUR
or
.Ev COMMAND_FLAVOUR
environment variables can be set to one of the following values, to implement only the corresponding options and behaviours:
.Bl -bullet
.It
posix : POSIX COMMAND
.It
unix | unix:v10 : Unix v10 COMMAND(1)
.It
bsd | bsd:freebsd : FreeBSD COMMAND(1)
.It
gnu | gnu:linux | linux : GNU/Linux COMMAND(1)
.It
plan9 : Plan 9 COMMAND(1)
.It
inferno : Inferno COMMAND(1)
.El
.Pp
However, if the
.Ev POSIXLY_CORRECT
environment variable is set to any value, then the POSIX flavour will be selected.
.Sh FILES
.Sh EXIT STATUS
.Ex -std COMMAND
Expand All @@ -44,6 +68,7 @@ The
.Nm
utility is a standard UNIX/POSIX command.
utility is a standard UNIX command, though not a POSIX one.
utility is not a standard UNIX command, though a usual one on Unix-like systems.
utility is not a standard UNIX command.
.Pp
This re-implementation tries to follow the PEP 8 style guide for Python code.
Expand All @@ -57,6 +82,9 @@ This re-implementation was made for the
It is available under the 3-clause BSD license.
.Sh AUTHORS
.An YOU
.Pp
This manual page is mainly based on the one written for FreeBSD by
.An HIM .
.Sh CAVEATS
.Sh BUGS
Bold:
Expand Down
44 changes: 44 additions & 0 deletions _template/man/LIBRARY.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.Dd MONTH DAY, YEAR
.Dt LIBRARY_NAME_UPPERCASE 3
.Os
.Sh NAME
.Nm LIBRARY_NAME
.Nd ONE_LINE_DESCRIPTION
.Sh SYNOPSIS
.Em import LIBRARY_NAME
.Pp
.Ft TYPE_Boolean_Character_Integer_Float_String_List
.Fo LIBRARY_NAME.FUNCTION_NAME
.Fa "TYPE ARGUMENT"
.Fa "TYPE ARGUMENT"
.Fc
.Ft TYPE
.Fo LIBRARY_NAME.FUNCTION_NAME
.Fa "TYPE ARGUMENT"
.Fc
.Sh DESCRIPTION
The
.Fn FUNCTION_NAME
function returns XXX if
.Fa ARGUMENT
is SOME_CONDITION or SOMETHING_ELSE if not.
.Sh ENVIRONMENT
The
.Ev LIBRARY_DEBUG
environment variable can be set to any value to enable debug mode.
.Sh SEE ALSO
.Xr COMMAND 1 ,
.Xr LIBRARY 3
.Sh STANDARDS
The
.Lb LIBRARY_NAME
tries to follow the PEP 8 style guide for Python code.
.Sh HISTORY
This library was made for the
.Lk https://github.com/HubTou/PNU PNU project
.Sh LICENSE
This library is available under the 3-clause BSD license.
.Sh AUTHORS
.An AUTHOR_NAME
.Sh CAVEATS
.Sh SECURITY CONSIDERATIONS
55 changes: 39 additions & 16 deletions _template/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,51 +1,74 @@
[metadata]
name = pnu_COMMAND
name = COMMAND
description = ONE_LINE_DESCRIPTION
long_description = file: README.md
long_description_content_type = text/markdown
version = 1.0.0
license = BSD 3-Clause License
license_files = License
author = YOU
author_email = nobody@nowhere.invalid
author_email = YOUR_EMAIL
url = https://github.com/YOU/COMMAND/
project_urls =
Bug Tracker = https://github.com/YOU/COMMAND/issues
keywords = pnu-project
classifiers =
Development Status :: 5 - Production/Stable <= if you are sufficiently confident...
Development Status :: 5 - Production/Stable <= If you are sufficiently confident...
Environment :: Console
Intended Audience :: Developers <= if you offer libraries functions
Intended Audience :: Developers <= If you offer libraries functions
Intended Audience :: End Users/Desktop
License :: OSI Approved :: BSD License
Natural Language :: English
Natural Language :: French <= If you have an internationalized command
Operating System :: OS Independent
Operating System :: POSIX :: BSD :: FreeBSD
Operating System :: Microsoft :: Windows
Operating System :: POSIX :: BSD :: FreeBSD <= If you implement the FreeBSD version of a command
Operating System :: Microsoft :: Windows <= If your command also work under Windows
Programming Language :: Python :: 3
Programming Language :: Python :: 3.x <= Get this from make check-version
Topic :: Software Development :: Libraries :: Python Modules <= if you offer libraries functions
Topic :: System <= for standard Unix utilities or system tools
Programming Language :: Python :: 3.0 <= then remove those that are not compatible
Programming Language :: Python :: 3.1
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development :: Libraries :: Python Modules <= If you offer libraries functions
Topic :: System <= For standard Unix utilities or system tools
Topic :: Utilities

[options]
package_dir =
= src
packages = find:
python_requires = >=3.x <= Get this from make check-version
install_requires = <= only if there are packages needed as dependencies
OTHER_PACKAGE <= only if there are packages needed as dependencies
python_requires = >=3.x <= Get this from make check-version
install_requires =
pnu-libpnu
OTHER_PACKAGE <= Only if there are other packages needed as dependencies

[options.extras_require] <= Only if you want to offer an install option
PACKAGE_OPTION = OTHER_PACKAGE <= Only if you want to offer an install option

[options.packages.find]
where = src

[options.entry_points]
console_scripts =
COMMAND = COMMAND:main <= the main name by which your utility will be called
OTHER_NAME = COMMAND:main <= another name by which your utility can be called if needed
COMMAND = COMMAND:main <= The main name by which your utility will be called
OTHER_NAME = COMMAND:main <= Another name by which your utility can be called if needed

[options.data_files]
man/man1 = <= beware the section number
man/COMMAND.1.gz <= beware the section number
man/OTHER_NAME.1.gz <= if needed...
man/man1 = <= Beware the section number
man/COMMAND.1.gz <= same
man/OTHER_NAME.1.gz <= If needed...
man/man3 = <= If you offer a library functions
man/COMMAND.3.gz <= same
share/locale/en/LC_MESSAGES = <= If you have an internationalized command
src/conjuguer/po/en/conjuguer.mo <= same
share/locale/fr/LC_MESSAGES = <= same
src/conjuguer/po/fr/conjuguer.mo <= same

Loading

0 comments on commit 661b5cb

Please sign in to comment.