From 7b8ce51a867eb04095176cf611a60354845bd475 Mon Sep 17 00:00:00 2001 From: Azad Rasul Date: Mon, 13 Mar 2023 13:12:44 +0300 Subject: [PATCH] first commit --- .editorconfig | 21 +++++ .github/ISSUE_TEMPLATE/bug_report.md | 25 +++++ .github/ISSUE_TEMPLATE/config.yml | 10 ++ .github/ISSUE_TEMPLATE/feature_request.md | 18 ++++ .github/workflows/build.yml | 42 +++++++++ .github/workflows/docs.yml | 24 +++++ .github/workflows/pypi.yml | 30 ++++++ .gitignore | 106 +++++++++++++++++++++ LICENSE | 22 +++++ MANIFEST.in | 7 ++ README.md | 21 +++++ docs/changelog.md | 11 +++ docs/contributing.md | 108 ++++++++++++++++++++++ docs/faq.md | 1 + docs/index.md | 20 ++++ docs/installation.md | 23 +++++ docs/overrides/main.html | 11 +++ docs/pylst.md | 4 + docs/usage.md | 7 ++ mkdocs.yml | 52 +++++++++++ pylst/__init__.py | 5 + pylst/pylst.py | 1 + requirements.txt | 0 requirements_dev.txt | 11 +++ setup.cfg | 22 +++++ setup.py | 58 ++++++++++++ tests/__init__.py | 1 + tests/test_pylst.py | 21 +++++ 28 files changed, 682 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/pypi.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 README.md create mode 100644 docs/changelog.md create mode 100644 docs/contributing.md create mode 100644 docs/faq.md create mode 100644 docs/index.md create mode 100644 docs/installation.md create mode 100644 docs/overrides/main.html create mode 100644 docs/pylst.md create mode 100644 docs/usage.md create mode 100644 mkdocs.yml create mode 100644 pylst/__init__.py create mode 100644 pylst/pylst.py create mode 100644 requirements.txt create mode 100644 requirements_dev.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 tests/__init__.py create mode 100644 tests/test_pylst.py diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d4a2c44 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.bat] +indent_style = tab +end_of_line = crlf + +[LICENSE] +insert_final_newline = false + +[Makefile] +indent_style = tab diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..1a0171a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug Report +about: Create a bug report to help us improve +labels: bug +--- + + + +### Environment Information + +- pylst version: +- Python version: +- Operating System: + +### Description + +Describe what you were trying to get done. +Tell us what happened, what went wrong, and what you expected to happen. + +### What I Did + +``` +Paste the command(s) you ran and the output. +If there was a crash, please include the traceback here. +``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c29b124 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +contact_links: + - name: Ask questions + url: https://github.com/Azad77/pylst/discussions/categories/q-a + about: Please ask and answer questions here. + - name: Ideas + url: https://github.com/Azad77/pylst/discussions/categories/ideas + about: Please share your ideas here. + - name: Ask questions from the GIS community + url: https://gis.stackexchange.com + about: To get answers from questions in the GIS community, please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..cf7acb9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature Request +about: Submit a feature request to help us improve +labels: Feature Request +--- + + + +### Description + +Describe the feature (e.g., new functions/tutorials) you would like to propose. +Tell us what can be achieved with this new feature and what's the expected outcome. + +### Source code + +``` +Paste your source code here if have sample code to share. +``` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1b3d677 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +on: + push: + branches: + - master + pull_request: + branches: + - master + +name: build +jobs: + py-check: + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.os }} (${{ matrix.config.py }}) + strategy: + fail-fast: false + matrix: + config: + - { os: windows-latest, py: "3.9" } + - { os: macOS-latest, py: "3.9" } + - { os: ubuntu-latest, py: "3.7" } + - { os: ubuntu-latest, py: "3.8" } + - { os: ubuntu-latest, py: "3.9" } + - { os: ubuntu-latest, py: "3.10" } + + env: + SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk + steps: + - name: CHECKOUT CODE + uses: actions/checkout@v3 + - name: SETUP PYTHON + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.config.py }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --user --no-cache-dir Cython + pip install --user -r requirements.txt + pip install --user -r requirements_dev.txt + - name: PKG-TEST + run: | + python -m unittest discover tests/ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..673f1fb --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,24 @@ +name: docs +on: + push: + branches: + - master +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --user --no-cache-dir Cython + pip install --user -r requirements.txt + - name: PKG-TEST + run: | + python -m unittest discover tests/ + - run: python -m pip install --upgrade pip + - run: pip install mkdocs-material mkdocstrings mkdocstrings-python-legacy mkdocs-git-revision-date-plugin mkdocs-jupyter ipykernel + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..2bbb0c0 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,30 @@ +# This workflows 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: pypi + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + 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_USERS }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..631004a --- /dev/null +++ b/.gitignore @@ -0,0 +1,106 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +private/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# 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/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# dotenv +.env + +# virtualenv +.venv +venv/ +ENV/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# IDE settings +.vscode/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b969091 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2023, Azad Rasul + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..89411aa --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,7 @@ +include LICENSE +include README.md +include requirements.txt + +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d27cb5a --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# pylst + + +[![image](https://img.shields.io/pypi/v/pylst.svg)](https://pypi.python.org/pypi/pylst) +[![image](https://img.shields.io/conda/vn/conda-forge/pylst.svg)](https://anaconda.org/conda-forge/pylst) + + +**A_Python_Package_for_processing_LST_data.** + + +- Free software: MIT license +- Documentation: https://Azad77.github.io/pylst + + +## Features + +- TODO + +## Credits + +This package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [giswqs/pypackage](https://github.com/giswqs/pypackage) project template. diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000..289e2c5 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,11 @@ +# Changelog + +## v0.0.1 - Date + +**Improvement**: + +- TBD + +**New Features**: + +- TBD diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 0000000..4090c97 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,108 @@ +# Contributing + +Contributions are welcome, and they are greatly appreciated! Every +little bit helps, and credit will always be given. + +You can contribute in many ways: + +## Types of Contributions + +### Report Bugs + +Report bugs at . + +If you are reporting a bug, please include: + +- Your operating system name and version. +- Any details about your local setup that might be helpful in troubleshooting. +- Detailed steps to reproduce the bug. + +### Fix Bugs + +Look through the GitHub issues for bugs. Anything tagged with `bug` and +`help wanted` is open to whoever wants to implement it. + +### Implement Features + +Look through the GitHub issues for features. Anything tagged with +`enhancement` and `help wanted` is open to whoever wants to implement it. + +### Write Documentation + +pylst could always use more documentation, +whether as part of the official pylst docs, +in docstrings, or even on the web in blog posts, articles, and such. + +### Submit Feedback + +The best way to send feedback is to file an issue at +. + +If you are proposing a feature: + +- Explain in detail how it would work. +- Keep the scope as narrow as possible, to make it easier to implement. +- Remember that this is a volunteer-driven project, and that contributions are welcome :) + +## Get Started! + +Ready to contribute? Here's how to set up pylst for local development. + +1. Fork the pylst repo on GitHub. + +2. Clone your fork locally: + + ```shell + $ git clone git@github.com:your_name_here/pylst.git + ``` + +3. Install your local copy into a virtualenv. Assuming you have + virtualenvwrapper installed, this is how you set up your fork for + local development: + + ```shell + $ mkvirtualenv pylst + $ cd pylst/ + $ python setup.py develop + ``` + +4. Create a branch for local development: + + ```shell + $ git checkout -b name-of-your-bugfix-or-feature + ``` + + Now you can make your changes locally. + +5. When you're done making changes, check that your changes pass flake8 + and the tests, including testing other Python versions with tox: + + ```shell + $ flake8 pylst tests + $ python setup.py test or pytest + $ tox + ``` + + To get flake8 and tox, just pip install them into your virtualenv. + +6. Commit your changes and push your branch to GitHub: + + ```shell + $ git add . + $ git commit -m "Your detailed description of your changes." + $ git push origin name-of-your-bugfix-or-feature + ``` + +7. Submit a pull request through the GitHub website. + +## Pull Request Guidelines + +Before you submit a pull request, check that it meets these guidelines: + +1. The pull request should include tests. +2. If the pull request adds functionality, the docs should be updated. + Put your new functionality into a function with a docstring, and add + the feature to the list in README.rst. +3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and + for PyPy. Check and make sure that the tests pass for all + supported Python versions. diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 0000000..4514b4c --- /dev/null +++ b/docs/faq.md @@ -0,0 +1 @@ +# FAQ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..612401c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,20 @@ +# Welcome to pylst + + +[![image](https://img.shields.io/pypi/v/pylst.svg)](https://pypi.python.org/pypi/pylst) + + +**A_Python_Package_for_processing_LST_data.** + + +- Free software: MIT license +- Documentation: + + +## Features + +- TODO + +## Credits + +This package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [giswqs/pypackage](https://github.com/giswqs/pypackage) project template. diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..db46f8b --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,23 @@ +# Installation + +## Stable release + +To install pylst, run this command in your terminal: + +``` +pip install pylst +``` + +This is the preferred method to install pylst, as it will always install the most recent stable release. + +If you don't have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process. + +## From sources + +The sources for pylst can be downloaded from the Github repo. + +You can clone the public repository: + +``` +git clone git://github.com/Azad77/pylst +``` diff --git a/docs/overrides/main.html b/docs/overrides/main.html new file mode 100644 index 0000000..702c96b --- /dev/null +++ b/docs/overrides/main.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} +{% if page.nb_url %} + + {% include ".icons/material/download.svg" %} + +{% endif %} + +{{ super() }} +{% endblock content %} diff --git a/docs/pylst.md b/docs/pylst.md new file mode 100644 index 0000000..ff1b2bb --- /dev/null +++ b/docs/pylst.md @@ -0,0 +1,4 @@ + +# pylst module + +::: pylst.pylst \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..7c1e7f5 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,7 @@ +# Usage + +To use pylst in a project: + +``` +import pylst +``` diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..42612f0 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,52 @@ +site_name: pylst + +site_url: https://Azad77.github.io/pylst + +repo_url: https://github.com/Azad77/pylst + +theme: + palette: + scheme: preference + name: material + icon: + repo: fontawesome/brands/github + features: + - navigation.instant + - search.highlight + # - navigation.expand + # - navigation.tabs + custom_dir: "docs/overrides" + +plugins: + - search + - mkdocstrings + - git-revision-date + - mkdocs-jupyter: + include_source: True + # ignore_h1_titles: True + # execute: True + # execute_ignore: "*.ipynb" + +markdown_extensions: + - attr_list + - pymdownx.superfences + - pymdownx.highlight: + linenums: true + - toc: + permalink: true + +# extra: +# analytics: +# provider: google +# property: UA-XXXXXXXXX-X + +nav: + - Home: index.md + - Installation: installation.md + - Usage: usage.md + - Contributing: contributing.md + - FAQ: faq.md + - Changelog: changelog.md + - Report Issues: https://github.com/Azad77/pylst/issues + - API Reference: + - pylst module: pylst.md diff --git a/pylst/__init__.py b/pylst/__init__.py new file mode 100644 index 0000000..4dc3c21 --- /dev/null +++ b/pylst/__init__.py @@ -0,0 +1,5 @@ +"""Top-level package for pylst.""" + +__author__ = """Azad Rasul""" +__email__ = 'azad.rasul@soran.edu.iq' +__version__ = '0.0.1' diff --git a/pylst/pylst.py b/pylst/pylst.py new file mode 100644 index 0000000..dd0b80e --- /dev/null +++ b/pylst/pylst.py @@ -0,0 +1 @@ +"""Main module.""" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 0000000..801556c --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,11 @@ +pip +bump2version +wheel +watchdog +flake8 +tox +coverage +Sphinx +twine +grip + diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..c2b3676 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,22 @@ +[bumpversion] +current_version = 0.0.1 +commit = True +tag = True + +[bumpversion:file:setup.py] +search = version='{current_version}' +replace = version='{new_version}' + +[bumpversion:file:pylst/__init__.py] +search = __version__ = '{current_version}' +replace = __version__ = '{new_version}' + +[bdist_wheel] +universal = 1 + +[flake8] +exclude = docs + +[aliases] +# Define setup.py command aliases here + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..dc36c93 --- /dev/null +++ b/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +"""The setup script.""" + +import io +from os import path as op +from setuptools import setup, find_packages + +with open('README.md') as readme_file: + readme = readme_file.read() + +here = op.abspath(op.dirname(__file__)) + +# get the dependencies and installs +with io.open(op.join(here, "requirements.txt"), encoding="utf-8") as f: + all_reqs = f.read().split("\n") + +install_requires = [x.strip() for x in all_reqs if "git+" not in x] +dependency_links = [x.strip().replace("git+", "") for x in all_reqs if "git+" not in x] + +requirements = [ ] + +setup_requirements = [ ] + +test_requirements = [ ] + +setup( + author="Azad Rasul", + author_email='azad.rasul@soran.edu.iq', + python_requires='>=3.7', + classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + ], + description="A_Python_Package_for_processing_LST_data.", + install_requires=install_requires, + dependency_links=dependency_links, + license="MIT license", + long_description=readme, + long_description_content_type='text/markdown', + include_package_data=True, + keywords='pylst', + name='pylst', + packages=find_packages(include=['pylst', 'pylst.*']), + setup_requires=setup_requirements, + test_suite='tests', + tests_require=test_requirements, + url='https://github.com/Azad77/pylst', + version='0.0.1', + zip_safe=False, +) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..89c3099 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Unit test package for pylst.""" diff --git a/tests/test_pylst.py b/tests/test_pylst.py new file mode 100644 index 0000000..592f29f --- /dev/null +++ b/tests/test_pylst.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +"""Tests for `pylst` package.""" + + +import unittest + +from pylst import pylst + + +class TestPylst(unittest.TestCase): + """Tests for `pylst` package.""" + + def setUp(self): + """Set up test fixtures, if any.""" + + def tearDown(self): + """Tear down test fixtures, if any.""" + + def test_000_something(self): + """Test something."""