Skip to content

Commit

Permalink
Merge pull request #2 from JordanWelsman/develop
Browse files Browse the repository at this point in the history
WIP: Develop new features
  • Loading branch information
JordanWelsman authored Jan 6, 2023
2 parents cfb1e06 + ef331bb commit 61cc7b9
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Python
.venv/

# Package
test.py

# Setuptools
build/
dist/
jutl.egg-info/
**/__pycache__/
Empty file added jutils/averages/__init__.py
Empty file.
Empty file added jutils/calculators/__init__.py
Empty file.
Empty file added jutils/converters/__init__.py
Empty file.
Empty file added jutils/cryptography/__init__.py
Empty file.
Empty file added jutils/formatting/__init__.py
Empty file.
Empty file added jutils/language/__init__.py
Empty file.
Empty file added jutils/logic/__init__.py
Empty file.
Empty file added jutils/pipelining/__init__.py
Empty file.
Empty file added jutils/sorters/__init__.py
Empty file.
Empty file added jutils/timers/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions jutils/utilities/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Import hello_world.py from /utilities/ so hello_world() is
# usable at 'from jutils import utilities' level.
from .hello_world import hello_world
17 changes: 17 additions & 0 deletions jutils/utilities/hello_world.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def hello_world(name: str = None) -> str:
"""
Greet the user.
Returns "Hello, 'user!'" where 'user' is 'name' if passed,
or "Hello, World!" if 'name' is not passed.
Parameters:
name (str): The user's name
Returns:
str: A greeting for the user
"""
if name:
return(f"Hello, {name}!")
else:
return(f"Hello, World!")
63 changes: 63 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Module imports
from setuptools import setup

# Arguments
git_name = "jutils"
pypi_name = "jutl"
version = "0.0.1"
python_version = ">=3.10"

# Long description from README.md
with open("README.md", "r") as fh:
long_description = fh.read()

# jutils package data
jutils_package_data = [
'averages/*',
'calculators/*',
'converters/*',
'cryptography/*',
'formatting/*',
'language/*',
'logic/*',
'pipelining/*',
'sorters/*',
'timers/*',
'utilities'
]

# Run setup function
setup(
name=pypi_name,
version=version,
description='A Python package of useful tools and utilities.',
license='MIT',
long_description=long_description,
long_description_content_type='text/markdown',
author='Jordan Welsman',
author_email='[email protected]',
url='https://pypi.org/project/'+pypi_name+"/",
download_url='https://github.com/JordanWelsman/jutils/tags',
package_data={'jutils': jutils_package_data},
python_requires=python_version,
# jutils package information
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'License :: OSI Approved :: MIT License',
'Topic :: Education',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Security',
'Topic :: Security :: Cryptography',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
'Programming Language :: Python :: 3',
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
],
keywords='python, averages, calculators, converters, cryptography, formatting, language, logic, pipelining, sorters, timers, utilities'
)
22 changes: 22 additions & 0 deletions unbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# jutils Unbuild Script
# To be used to delete the directories & files created by `python setup.py bdist_wheel`.

# Author : Jordan Welsman
# Copyright : Jordan Welsman

echo "You are about to delete files & folders from jutils."
echo "These files are crucial to the ability to install and import jutils."
read -p "Do you want to continue? [Y/n]: "

if [[ $REPLY =~ ^[Yy]$ ]]
then
rm -rf build # remove build directory if exists
rm -rf dist # remove distribution directory if exists
rm -rf jutl.egg-info # remove egg info directory if exists
find . -name __pycache__ -type d -print0|xargs -0 rm -r -- # remove all pycache directories
echo "Project successfully unbuilt."
else
echo "Operation aborted."
fi

0 comments on commit 61cc7b9

Please sign in to comment.