Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Setup configuration #2

Merged
merged 7 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence.
* @F4ever @infloop @avsetsin
45 changes: 0 additions & 45 deletions .github/workflows/devenv.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: [3.6, 3.7]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
Expand All @@ -37,6 +37,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: pre-commit Checkers and Formatters
run: |
pre-commit install
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: [3.6, 3.7]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
Expand All @@ -37,6 +37,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: pre-commit Checkers and Formatters
run: |
pre-commit install
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: [3.6, 3.7]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
Expand All @@ -37,6 +37,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: pre-commit Checkers and Formatters
run: |
pre-commit install
Expand Down
147 changes: 140 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,141 @@
.idea/
# 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/
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/
./mypackage/__pycache__/
./docs/.build/
./docs/.static/
./docs/.templates/
devenv/
mypackage.egg-info/
cover/

# 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
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .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/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Project
.idea/
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/psf/black
rev: stable
rev: 21.7b0
hooks:
- id: black
args: [--quiet]
language_version: python3

- repo: https://github.com/asottile/blacken-docs
rev: v1.3.0
rev: v1.10.0
hooks:
- id: blacken-docs
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:
image: latest

python:
version: 3.6
version: 3.9
setup_py_install: false
pip_install: true

Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ matrix:
language: shell

install:
- pip3 install virtualenv # this line have to be performed in Travis OSX, but it's not required for linux
- pip3 install virtualenv
- virtualenv devenv
- source devenv/bin/activate
- pip3 install -r requirements.txt
Expand All @@ -38,6 +38,6 @@ script:
notifications:
email:
recipients:
- your.email@somewhere.com
on_success: change
on_failure: change
- roman.s@p2p.org
on_success: never
on_failure: always
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# CHANGELOG

All notable changes to this project are documented in this file.

This changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/lidofinance/lido-python-sdk)

## [0.1.0](https://github.com/lidofinance/lido-python-sdk) - 2021-10-20
### Added
- Operators [#0001](https://github.com/lidofinance/lido-python-sdk/pull/1)

### Changed
- Initial release

### Fixed
- Configuration setup ([#0002](https://github.com/lidofinance/lido-python-sdk/pull/2))
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Diego Volpatto
Copyright (c) 2021 P2P

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
# A generic blank Python project
# Lido Python SDK

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Build Status](https://travis-ci.com/volpatto/blank-python-project.svg?branch=master)](https://travis-ci.com/volpatto/blank-python-project)
![](https://github.com/volpatto/blank-python-project/workflows/linux/badge.svg?branch=master)
![](https://github.com/volpatto/blank-python-project/workflows/osx/badge.svg?branch=master)
![](https://github.com/volpatto/blank-python-project/workflows/windows/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/volpatto/blank-python-project/branch/master/graph/badge.svg)](https://codecov.io/gh/volpatto/blank-python-project)
[![Documentation Status](https://readthedocs.org/projects/blank-python-project/badge/?version=latest)](https://blank-python-project.readthedocs.io/en/latest/?badge=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/gh/volpatto/blank-python-project/branch/master/graph/badge.svg)](https://github.com/lidofinance/lido-validator-python)

This repo provides a scratch of a Python project. Its purpose is to serve as starting point for
the development of a Python project based on a minimal working structure.

## Development
Clone project:
```bash
git clone git@github.com:lidofinance/lido-python-sdk.git
cd lido-python-sdk
```
Create virtual env:
```bash
virtualenv .env --python=python3
source .env/bin/activate
```
Install all dependencies:
```bash
pip install -r requirements.txt
pip install -r requirements-dev.txt
```

## How to test
Simply run in project root directory:
```bash
pytest .
```

## Covered features

* A preconfigured setup.py file following the suggestions from [here](https://github.com/kennethreitz/setup.py);
* [Sphinx](http://www.sphinx-doc.org/en/master/) autodocumentation with [autodoc](https://docs-python2readthedocs.readthedocs.io/en/master/code-doc.html);
* [Travis CI](https://travis-ci.com) minimal configuration;
* [GitHub Actions](https://github.com/features/actions) workflows with minimal configurations for latest Ubuntu, macOS and Windows;
* Tests with [pytest](https://docs.pytest.org/en/latest/);
* Development environment with two options:
* The classic [virtualenv](https://virtualenv.pypa.io/en/latest/)
* A [conda](https://conda.io/en/latest/) environment with [conda-devenv](https://github.com/ESSS/conda-devenv) extension
* [virtualenv](https://virtualenv.pypa.io/en/latest/)
* Hierarchical structure to a python package as suggested by ["The Hitchhiker’s Guide to Python"](https://docs.python-guide.org/) (highly recommended reading);
* A [Read The Docs](https://readthedocs.org/) configuration scratch;
* [pre-commit](https://pre-commit.com/) to perform git hooks before commits. The following plugins are being used:
Expand All @@ -30,13 +45,3 @@ the development of a Python project based on a minimal working structure.
- black (default options combined with customized line length to 100 chars per line)
- blacken-docs
* Coverage of the package with [Codecov](https://codecov.io/).

## Contributions

Contributions are VERY welcome. But please be aware of the purpose of the repo: **A minimal working structure.** If you want to add a feature which is very particular to your needs, please analyse if it fits the objective.

Suggestions and advices are welcome, feel free to open an Issue or send me an email.

## Contact

My name is Diego. Feel free to contact me through the email <volpatto@lncc.br>.
Loading