Skip to content

Commit 8e98045

Browse files
authored
Merge pull request #6 from Thanatisia/v0.4.5
Merged v0.4.5 to main - Please refer to CHANGELOGS for a full list
2 parents 9156554 + 9c9b55c commit 8e98045

27 files changed

+625
-42
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ env/
55

66
## python cache folders
77
__pycache__/
8+
*.egg-info/
89

910
## YAML Configuration Files
1011
*.yaml

CHANGELOGS.md

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,24 @@
1717
+ v0.2.12 | 2023-12-02 0949H | Merged to main
1818
+ v0.2.13 | 2023-12-02 1020H | Merged to main
1919
+ v0.3.0 | 2023-12-02 1024H | Merged to main
20-
+ v0.3.1 | 2023-12-03 2251H | Development
21-
+ v0.3.2 | 2023-12-03 2344H | Development
22-
+ v0.3.3 | 2023-12-03 2354H | Development
23-
+ v0.3.4 | 2023-12-04 1246H | Development
24-
+ v0.3.5 | 2023-12-04 1253H | Development
25-
+ v0.3.6 | 2023-12-04 1331H | Development
26-
+ v0.3.7 | 2023-12-04 2141H | Development
27-
+ v0.3.8 | 2023-12-04 2200H | Development
28-
+ v0.3.9 | 2023-12-04 2243H | Development
29-
+ v0.3.10 | 2023-12-04 2333H | Development
30-
+ v0.3.11 | 2023-12-05 1946H | Development
31-
+ v0.3.12 | 2023-12-05 2006H | Development
32-
+ v0.4.0 | 2023-12-11 1227H | Development
20+
+ v0.3.1 | 2023-12-03 2251H | Merged to main
21+
+ v0.3.2 | 2023-12-03 2344H | Merged to main
22+
+ v0.3.3 | 2023-12-03 2354H | Merged to main
23+
+ v0.3.4 | 2023-12-04 1246H | Merged to main
24+
+ v0.3.5 | 2023-12-04 1253H | Merged to main
25+
+ v0.3.6 | 2023-12-04 1331H | Merged to main
26+
+ v0.3.7 | 2023-12-04 2141H | Merged to main
27+
+ v0.3.8 | 2023-12-04 2200H | Merged to main
28+
+ v0.3.9 | 2023-12-04 2243H | Merged to main
29+
+ v0.3.10 | 2023-12-04 2333H | Merged to main
30+
+ v0.3.11 | 2023-12-05 1946H | Merged to main
31+
+ v0.3.12 | 2023-12-05 2006H | Merged to main
32+
+ v0.4.0 | 2023-12-11 1227H | Merged to main
33+
+ v0.4.1 | 2024-01-29 1026H | Testing for new feature: Project structure Packaging and Deployment
34+
+ v0.4.2 | 2024-01-29 1758H | Testing for new feature: Project structure Packaging and Deployment
35+
+ v0.4.3 | 2024-01-29 1758H | Testing for new feature: Project structure Packaging and Deployment
36+
+ v0.4.4 | 2024-01-29 2227H | Testing for new feature: Project structure Packaging and Deployment
37+
+ v0.4.5 | 2024-01-30 1358H | Testing for new feature: Project structure Packaging and Deployment
3338

3439
## Entries
3540

@@ -497,3 +502,62 @@
497502
- i.e. archlinux's pacstrap requiring pacman to exist
498503
+ installing natively on a non-ArchLinux system is borderline impossible or unnecessarily hard
499504

505+
### v0.4.1
506+
+ Preparation of project structure for packaging and deployment
507+
- New
508+
+ Created new package folder 'distinstall-python' in 'src/' for holding the program as a package
509+
+ Created setup.py for setuptools
510+
+ Added pyproject.toml for packaging
511+
- Added '__init__.py' and '__main__.py' to 'src/'
512+
- '__init__.py' will initialize the project folder as a importable package/module, like a constructor initializer
513+
- '__main__.py' is a special macro function that will act as an alias to main.py in python
514+
+ Python will find '__main__.py' as the launcher/entry point, and if it is found, python will execute a special runtime instruction set for these magic functions
515+
+ TODO: Find out how to set main.py as the entry point instead
516+
- Added '__init__.py' and '__main__.py' to 'src/app'
517+
- '__init__.py' will initialize the project folder as a importable package/module, like a constructor initializer
518+
519+
- Updates
520+
- 'mechanism.py' in 'src/app/distributions/archlinux'
521+
- Modified package/module importing in mechanism.py
522+
+ Used '.' as a relative path backwards up the parent directory tree, with each '.' being 1 directory upwards
523+
+ TODO: Figure out how to add the module directories into the packaging so that '.' isnt needed
524+
- Added variables 'stdout, stderr and returncode' to timedatectl function
525+
- Removed 'loading' message and the standard output print as these are too verbose
526+
- 'runner.py' in 'src/app'
527+
- Modified package/module importing
528+
+ Used '.' as a relative path backwards up the parent directory tree, with each '.' being 1 directory upwards
529+
+ TODO: Figure out how to add the module directories into the packaging so that '.' isnt needed
530+
- 'device_management.py' in 'src/lib'
531+
- Modified package/module importing
532+
+ Used '.' as a relative path backwards up the parent directory tree, with each '.' being 1 directory upwards
533+
+ TODO: Figure out how to add the module directories into the packaging so that '.' isnt needed
534+
- 'user_management.py' in 'src/lib'
535+
- Modified package/module importing
536+
+ Used '.' as a relative path backwards up the parent directory tree, with each '.' being 1 directory upwards
537+
+ TODO: Figure out how to add the module directories into the packaging so that '.' isnt needed
538+
- 'setup.py' in 'src/'
539+
- Modified package/module importing
540+
+ Used '.' as a relative path backwards up the parent directory tree, with each '.' being 1 directory upwards
541+
+ TODO: Figure out how to add the module directories into the packaging so that '.' isnt needed
542+
543+
### v0.4.2
544+
- Updates
545+
+ Moved project structure from 'src/' to folder 'src/distinstall-python' as a package
546+
547+
### v0.4.3
548+
- Updates
549+
+ Deleted remnants after moving to package folder 'distinstall-python'
550+
551+
### v0.4.4
552+
- Updates
553+
- README.md
554+
+ Added instructions to install python using setuptools packaging and deployment (via pip)
555+
556+
### v0.4.5
557+
- New
558+
- Added new document 'CONTRIBUTING.md' for information relating to contribution rulesets
559+
560+
- Updates
561+
- Updated 'setup.py' and 'pyproject.toml' with latest version and setup entry point
562+
- Updated 'main.py' to be in sync with '__main__.py'
563+

CONTRIBUTING.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# CONTRIBUTING
2+
3+
## Table of Contents
4+
+ [Rules](#rules)
5+
+ [Distribution and Packaging](#distribution-and-packaging)
6+
7+
## Rules
8+
### Open Source Contribution
9+
- Create a fork/branch to your contribution
10+
- Open Pull Request to request to merge your updates
11+
- Please specify your contribution details in the following in your Pull Request
12+
+ Title: `[category] : [summary]`
13+
- Body:
14+
```
15+
Author Name: [your-name]
16+
Files Modified:
17+
- Files changed here
18+
Reason/Motivation:
19+
Summary:
20+
- Your changes here
21+
```
22+
+ Do not force merge directly to the main branch
23+
24+
## Distribution and Packaging
25+
### Pre-Requisites
26+
- (Optional) Create Virtual Environments for isolation testing/usage
27+
- Create the Virtual Environment container
28+
```console
29+
python -m venv env
30+
```
31+
- Chroot and enter Virtual Environment
32+
- Linux
33+
```console
34+
. env/bin/activate
35+
```
36+
- Windows
37+
```console
38+
.\env\Scripts\activate
39+
```
40+
41+
- Change directory into project root directory
42+
```console
43+
cd [project-root-directory]
44+
```
45+
46+
### Development and Testing
47+
- Install framework using pip
48+
- Locally as development mode
49+
```console
50+
pip install .
51+
```
52+
53+
### Building
54+
#### Using setuptools
55+
- Build/Compile static files
56+
- Explanation
57+
+ This will compile/"package" the source files into an 'egg', .tar and wheel static files for sharing and installation
58+
```console
59+
python setup.py build
60+
```
61+
62+
### Installation
63+
- Local installation
64+
- Install built static files using setup.py with setuptools
65+
- Explanation
66+
+ This will install all dependencies, pre-requisites using setup.py and install the framework/package defined in setup.py
67+
```console
68+
python setup.py install
69+
```
70+
- Install built static distribution files
71+
- tarball
72+
```console
73+
pip install dist/[package-name]-[version-number].tar.gz
74+
```
75+
- wheel
76+
```console
77+
pip install dist/[package-name]-[version-number]-[python-version].whl
78+
```
79+
- egg file
80+
```console
81+
pip install dist/[package-name]-[version-number]-[python-version].egg
82+
```
83+
84+
- Remote installation
85+
- Install from PyPI (WIP)
86+
```console
87+
pip install distinstall-python
88+
```
89+
- Install from GtiHub
90+
```console
91+
pip install https://github.com/Thanatisia/distinstall-python{@[branch-tag-name]}
92+
```
93+
94+
## Resources
95+
96+
## References
97+
98+
## Remarks
99+

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,27 @@
181181
apt install < pkglist.txt
182182
```
183183

184-
- Install python dependencies
185-
- From requirements.txt
184+
- Running framework/package from source
185+
- Install python dependencies
186+
- From requirements.txt
187+
```console
188+
python -m pip install -Ur requirements.txt
189+
```
190+
191+
- Install framework using pip
192+
- Locally as development mode
186193
```console
187-
python -m pip install -Ur requirements.txt
194+
pip install .
188195
```
196+
- Remote installation
197+
- Install from PyPI (WIP)
198+
```console
199+
pip install distinstall-python
200+
```
201+
- Install from GtiHub
202+
```console
203+
pip install https://github.com/Thanatisia/distinstall-python{@[branch-tag-name]}
204+
```
189205

190206
- (Optional) If you are installing into a Virtual Disk Image on Host
191207
- Mount Disk Image and Partitions as loopback devices

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tool.poetry]
2+
name = "distinstall-python"
3+
version = "0.4.5"
4+
description = "Portable, Customizable and Modular distribution installation library/framework"
5+
authors = ["Thanatisia <55834101+Thanatisia@users.noreply.github.com>"]
6+
readme = "README.md"
7+
packages = [
8+
{include = "distinstall-python", from="src"}
9+
]
10+
11+
[tool.poetry.dependencies]
12+
python = "^3.11"
13+
build = "^1.0.3"
14+
15+
16+
[build-system]
17+
requires = ["poetry-core", "ruamel.yaml"]
18+
build-backend = "poetry.core.masonry.api"

setup.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from setuptools import setup, find_packages
2+
import pkg_resources
3+
4+
"""
5+
General setup
6+
"""
7+
setup(
8+
name="distinstall-python",
9+
version="0.4.5",
10+
description = "Portable, Customizable and Modular distribution installation library/framework",
11+
author="Thanatisia",
12+
author_email="55834101+Thanatisia@users.noreply.github.com",
13+
packages=find_packages(),
14+
package_dir={'':'src/distinstall-python'},
15+
install_requires=[
16+
# List of dependencies here
17+
"ruamel.yaml"
18+
],
19+
url="https://github.com/Thanatisia/distinstall-python",
20+
classifiers=[
21+
"License :: OSI Approved :: MIT License",
22+
"Programming language :: Python :: 3.11",
23+
],
24+
entry_points = {
25+
# Set entry points here
26+
"console_scripts" : [
27+
"main = src.distinstall-python.main:main",
28+
],
29+
},
30+
)
31+
32+
"""
33+
Entry point setup
34+
"""
35+
named_objects = {}
36+
37+
# Loop through all entry points in a group and populate named objects dictionary
38+
for entry_point in pkg_resources.iter_entry_points(group='main'):
39+
# Populate named objects dictionary mapping with the entry points
40+
named_objects.update({entry_point.name : entry_point.load()})
41+

src/distinstall-python/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)