Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zaccharieramzi committed Jan 7, 2022
0 parents commit 13b89a0
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will install Python dependencies, run tests with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Continuous testing

on:
push:
branches:
- 'master'

pull_request:
branches:
- 'master'

jobs:
test:
name: Test Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install .
- name: Test with pytest
run: pytest -s my_package/tests
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# My usual private notebooks directory

personal_experiments/
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# My python package template

![GitHub Workflow Build Status](https://github.com/zaccharieramzi/my-python-package-template/workflows/Continuous%20testing/badge.svg)

With Readme, gitignore, travis, GitHub workflow, reqs and tree structure

TODO to make the repo viable:
- [ ] change the name of the `my_package` folder
- [ ] change the name of the package in `setup.py`
- [ ] change the name of the test folder in the GitHub action
- [ ] Updated the Readme
9 changes: 9 additions & 0 deletions build_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/bash

rm -f -r build/*
rm -f -r dist/*

pip install --upgrade setuptools wheel twine

python setup.py sdist bdist_wheel
twine upload -r testpypi dist/*
Empty file added my_package/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions my_package/tests/unit_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_work():
assert True
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import setuptools

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

# taken from https://github.com/CEA-COSMIC/ModOpt/blob/master/setup.py
with open('requirements.txt') as open_file:
install_requires = open_file.read()

setuptools.setup(
name="my-python-package-template",
version="0.0.1",
author="Zaccharie Ramzi",
author_email="[email protected]",
description="My Python package template.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/zaccharieramzi/my-python-package-template",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=install_requires,
python_requires='>=3.6',
)

0 comments on commit 13b89a0

Please sign in to comment.