Skip to content

Prepare pytask-environment to be published on PyPI. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 27, 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
2 changes: 0 additions & 2 deletions .conda/bld.bat

This file was deleted.

1 change: 0 additions & 1 deletion .conda/build.sh

This file was deleted.

5 changes: 4 additions & 1 deletion .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ source:
build:
noarch: python
number: 0
script: {{ PYTHON }} setup.py install --single-version-externally-managed --record record.txt

requirements:
host:
- python
- pip
- setuptools

run:
Expand All @@ -38,6 +40,7 @@ test:

about:
home: https://github.com/pytask-dev/pytask-environment
license: none
license: MIT
license_file: LICENSE
summary: Ensure checks on the current Python environment.
dev_url: https://github.com/pytask-dev/pytask-environment/
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/pytask_environment/_version.py export-subst
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---

name: Bug Report
about: Create a bug report to help us improve pytask-latex
about: Create a bug report to help us improve pytask-environment
title: "BUG:"
labels: "bug"

---

- [ ] I have checked that this issue has not already been reported.

- [ ] I have confirmed this bug exists on the latest version of pytask-latex.
- [ ] I have confirmed this bug exists on the latest version of pytask-environment.

- [ ] (optional) I have confirmed this bug exists on the `main` branch of
pytask-latex.
pytask-environment.

---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ labels: "documentation"
Provide the location of the documentation, e.g. an URL of the documentation.

**Note**: You can check the latest versions of the docs on `main`
[here](https://pytask-latex.readthedocs.io/en/latest).
[here](https://pytask-environment.readthedocs.io/en/latest).

#### Documentation problem

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---

name: Enhancement
about: Suggest an idea for pytask-latex
about: Suggest an idea for pytask-environment
title: "ENH:"
labels: "enhancement"

---

#### Is your feature request related to a problem?

Provide a description of what the problem is, e.g. "I wish I could use pytask-latex
Provide a description of what the problem is, e.g. "I wish I could use pytask-environment
to do [...]".

#### Describe the solution you'd like
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---

name: Submit Question
about: Ask a general question about pytask-latex
about: Ask a general question about pytask-environment
title: "QST:"
labels: "question"

---

#### Question about pytask-latex
#### Question about pytask-environment

**Note**: If you'd still like to submit a question, please read [this guide](
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PyPI

on: push

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install pypa/build
run: >-
python -m
pip install
build
--user

- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
- id: codespell
args: [-L=als]
- id: codespell
args: [-L als, -L unparseable]
- repo: https://github.com/mgedmin/check-manifest
rev: "0.46"
hooks:
- id: check-manifest
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ all releases are available on `Anaconda.org
<https://anaconda.org/pytask/pytask-environment>`_.


0.0.2 - 2021-02-27
------------------

- :gh:`3` prepares pytask-environment to be published on PyPI, adds versioneer, and
more.


0.0.1 - 2020-10-04
------------------

Expand Down
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright 2020-2021 Tobias Raabe

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.
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include LICENSE
include versioneer.py
include src/pytask_environment/_version.py

exclude *.rst
exclude *.yml
exclude *.yaml
exclude tox.ini

prune .conda
prune tests
22 changes: 21 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.. image:: https://img.shields.io/pypi/v/pytask-environment?color=blue
:alt: PyPI
:target: https://pypi.org/project/pytask-environment

.. image:: https://img.shields.io/pypi/pyversions/pytask-environment
:alt: PyPI - Python Version
:target: https://pypi.org/project/pytask-environment

.. image:: https://anaconda.org/pytask/pytask-environment/badges/version.svg
:target: https://anaconda.org/pytask/pytask-environment

Expand All @@ -7,9 +15,16 @@
.. image:: https://github.com/pytask-dev/pytask-environment/workflows/Continuous%20Integration%20Workflow/badge.svg?branch=main
:target: https://github.com/pytask-dev/pytask/actions?query=branch%3Amain

.. image:: https://img.shields.io/pypi/l/pytask-environment
:alt: PyPI - License

.. image:: https://codecov.io/gh/pytask-dev/pytask-environment/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pytask-dev/pytask-environment

.. image:: https://results.pre-commit.ci/badge/github/pytask-dev/pytask-environment/main.svg
:target: https://results.pre-commit.ci/latest/github/pytask-dev/pytask-environment/main
:alt: pre-commit.ci status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

Expand All @@ -25,10 +40,15 @@ project build.
Installation
------------

Install the plugin with
pytask-environment is available on `PyPI <https://pypi.org/project/pytask-environment>`_
and `Anaconda.org <https://anaconda.org/pytask/pytask-environment>`_. Install it with

.. code-block:: console

$ pip install pytask-environment

# or

$ conda config --add channels conda-forge --add channels pytask
$ conda install pytask-environment

Expand Down
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ coverage:
ignore:
- ".tox/**/*"
- "setup.py"
- "versioneer.py"
- "src/pytask_environment/_version.py"
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dependencies:
- pre-commit
- pytest-cov
- pytest-xdist
- versioneer
17 changes: 7 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[bumpversion]
current_version = 0.0.4
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))(\-?((dev)?(?P<dev>\d+))?)
serialize =
{major}.{minor}.{patch}dev{dev}
{major}.{minor}.{patch}

[bumpversion:file:setup.py]

[bumpversion:file:src/pytask_latex/__init__.py]
[versioneer]
VCS = git
style = pep440
versionfile_source = src/pytask_environment/_version.py
versionfile_build = pytask_environment/_version.py
tag_prefix = v
parentdir_prefix = pytask-environment-
39 changes: 38 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,47 @@
from pathlib import Path

from setuptools import find_packages
from setuptools import setup

import versioneer

README = Path("README.rst").read_text()

PROJECT_URLS = {
"Documentation": "https://github.com/pytask-dev/pytask-environment",
"Github": "https://github.com/pytask-dev/pytask-environment",
"Tracker": "https://github.com/pytask-dev/pytask-environment/issues",
"Changelog": "https://github.com/pytask-dev/pytask-environment/blob/main/"
"CHANGES.rst",
}


setup(
name="pytask-environment",
version="0.0.1",
version=versioneer.get_version(),
cmd_class=versioneer.get_cmdclass(),
description="Detect changes in your pytask environment and abort a project build.",
long_description=README,
long_description_content_type="text/x-rst",
author="Tobias Raabe",
author_email="raabe@posteo.de",
python_requires=">=3.6",
url=PROJECT_URLS["Github"],
project_urls=PROJECT_URLS,
license="MIT",
classifiers=[
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
platforms="any",
packages=find_packages(where="src"),
package_dir={"": "src"},
entry_points={"pytask": ["pytask_environment = pytask_environment.plugin"]},
zip_false=False,
)
5 changes: 5 additions & 0 deletions src/pytask_environment/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
__version__ = "0.0.1"

from ._version import get_versions

__version__ = get_versions()["version"]
del get_versions
Loading