Skip to content

Commit

Permalink
Merge pull request #18 from sepandhaghighi/dev
Browse files Browse the repository at this point in the history
Version 0.1
  • Loading branch information
sepandhaghighi authored Oct 30, 2020
2 parents 042c4bc + 21fc10b commit ca6d35a
Show file tree
Hide file tree
Showing 32 changed files with 845 additions and 115 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
branch = True
omit =
*/nafas/__main__.py
*/nafas/__init__.py
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
pragma: no cover
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
17 changes: 17 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contribution

Changes and improvements are more than welcome! ❤️ Feel free to fork and open a pull request.


Please consider the following :


1. Fork it!
2. Create your feature branch (under `dev` branch)
3. Add your functions/methods to proper files
4. Add standard `docstring` to your functions/methods
5. Add tests for your functions/methods (`doctest` testcases in `test` folder)
6. Pass all CI tests
7. Update `CHANGELOG.md`
- Describe changes under `[Unreleased]` section
8. Submit a pull request into `dev` (please complete the pull request template)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#### Description

#### Steps/Code to Reproduce

#### Expected Behavior

#### Actual Behavior

#### Operating System

#### Python Version

#### Nafas Version (Use : `nafas.__version__`)
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#### Reference Issues/PRs

#### What does this implement/fix? Explain your changes.


#### Any other comments?

34 changes: 34 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*.tar.gz
twine upload dist/*.whl
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var/
# 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
Expand Down
45 changes: 45 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
language: python

matrix:
include:
- os: linux
python: 3.8
dist: xenial
- os: linux
python: 3.7
dist: xenial
- os: linux
python: 3.6
- os: linux
python: 3.5
- os: osx
language: generic
env: TOXENV=py36
- os: linux
python: 3.7-dev
dist: xenial
- os: linux
python: 3.8-dev
dist: xenial
- os: linux
python: 3.9-dev
dist: xenial
- os: linux
python: nightly
dist: xenial
allow_failures:
- os: linux
python: 3.9-dev
dist: xenial
- os: linux
python: nightly
dist: xenial
install:
- chmod +x .travis/install.sh
- .travis/install.sh
before_script:
- chmod +x .travis/test.sh
script:
- .travis/test.sh
after_success:
- codecov
24 changes: 24 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
set -x

PYTHON_COMMAND=python
PIP_COMMAND=pip
if [ "$TRAVIS_OS_NAME" == "osx" ]
then
PYTHON_COMMAND=python3
PIP_COMMAND=pip3
fi

$PIP_COMMAND install -r requirements.txt
$PYTHON_COMMAND setup.py install
$PYTHON_COMMAND -m nafas test

if [ "$TRAVIS_OS_NAME" == "osx" ]
then
$PIP_COMMAND install --upgrade --upgrade-strategy=only-if-needed -r dev-requirements.txt --user
else
$PIP_COMMAND install --upgrade --upgrade-strategy=only-if-needed -r dev-requirements.txt
fi


25 changes: 25 additions & 0 deletions .travis/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
set -x
IS_IN_TRAVIS=false
PYTHON_COMMAND=python

if [ "$TRAVIS_OS_NAME" == "osx" ]
then
PYTHON_COMMAND=python3
fi
$PYTHON_COMMAND -m pytest test --cov=nafas --cov-report=term
$PYTHON_COMMAND otherfiles/version_check.py

if [ "$CI" = 'true' ] && [ "$TRAVIS" = 'true' ]
then
IS_IN_TRAVIS=true
fi

if [ "$IS_IN_TRAVIS" = 'false' ] || [ "$TRAVIS_PYTHON_VERSION" = '3.6' ]
then
$PYTHON_COMMAND -m vulture nafas/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size
$PYTHON_COMMAND -m bandit -r nafas -s B311
$PYTHON_COMMAND -m pydocstyle --match-dir=nafas -v
fi

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.1] - 2020-08-23
## [0.1] - 2020-10-30
### Added
- Clear Mind program
- Relax program
Expand All @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Cigarette Replace program

[Unreleased]: https://github.com/sepandhaghighi/nafas/compare/v0.1...dev
[0.1]: https://github.com/sepandhaghighi/nafas/compare/1e238cd...v0.1
[0.1]: https://github.com/sepandhaghighi/nafas/compare/c58087a...v0.1



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) 2017 Sepand Haghighi
Copyright (c) 2020 Sepand Haghighi

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
31 changes: 31 additions & 0 deletions NAFAS.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- mode: python -*-

block_cipher = None


a = Analysis(['nafas/__main__.py'],
pathex=['nafas'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='NAFAS',
debug=False,
strip=False,
upx=True,
runtime_tmpdir=None,
icon='otherfiles/icon.ico',
version="otherfiles/Version.rc",
console=True )
Loading

0 comments on commit ca6d35a

Please sign in to comment.