Skip to content

Commit b2c0640

Browse files
authored
Prepare pytask-stata to be published on PyPI. (#6)
1 parent e12bbbc commit b2c0640

18 files changed

+2625
-20
lines changed

.conda/bld.bat

-2
This file was deleted.

.conda/build.sh

-1
This file was deleted.

.conda/meta.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ package:
55
version: {{ data.get('version') }}
66

77
source:
8-
# git_url is nice in that it won't capture devenv stuff. However, it only captures
8+
# git_url is nice in that it won't capture devenv stuff. However, it only captures
99
# committed code, so pay attention.
1010
git_url: ../
1111

1212
build:
1313
noarch: python
1414
number: 0
15+
script: {{ PYTHON }} setup.py install --single-version-externally-managed --record record.txt
1516

1617
requirements:
1718
host:
1819
- python
20+
- pip
1921
- setuptools
2022

2123
run:
@@ -40,6 +42,7 @@ test:
4042

4143
about:
4244
home: https://github.com/pytask-dev/pytask-stata
43-
license: none
45+
license: MIT
46+
license_file: LICENSE
4447
summary: Execute do-files with Stata.
4548
dev_url: https://github.com/pytask-dev/pytask-stata/

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/pytask_stata/_version.py export-subst

.github/workflows/publish-to-pypi.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to PyPI
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
12+
- name: Set up Python 3.8
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.8
16+
17+
- name: Install pypa/build
18+
run: >-
19+
python -m
20+
pip install
21+
build
22+
--user
23+
24+
- name: Build a binary wheel and a source tarball
25+
run: >-
26+
python -m
27+
build
28+
--sdist
29+
--wheel
30+
--outdir dist/
31+
32+
- name: Publish distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags')
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
password: ${{ secrets.PYPI_API_TOKEN }}

.pre-commit-config.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ repos:
7979
- repo: https://github.com/codespell-project/codespell
8080
rev: v2.0.0
8181
hooks:
82-
- id: codespell
82+
- id: codespell
83+
args: [-L unparseable]
84+
- repo: https://github.com/mgedmin/check-manifest
85+
rev: "0.46"
86+
hooks:
87+
- id: check-manifest
8388
- repo: meta
8489
hooks:
8590
- id: check-hooks-apply

CHANGES.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ Changes
33

44
This is a record of all past pytask-stata releases and what went into them in reverse
55
chronological order. Releases follow `semantic versioning <https://semver.org/>`_ and
6-
all releases are available on `Anaconda.org <https://anaconda.org/pytask/pytask-stata>`_.
6+
all releases are available on `PyPI <https://pypi.org/project/pytask-stata>`_ and
7+
`Anaconda.org <https://anaconda.org/pytask/pytask-stata>`_.
8+
9+
10+
0.0.4 - 2021-02-25
11+
------------------
12+
13+
- :gh:`6` prepares pytask-stata to be published on PyPI, adds versioneer and more.
714

815

916
0.0.3 - 2021-01-16

LICENSE

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright 2020-2021 Tobias Raabe
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
software and associated documentation files (the "Software"), to deal in the Software
5+
without restriction, including without limitation the rights to use, copy, modify,
6+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7+
permit persons to whom the Software is furnished to do so, subject to the following
8+
conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or
11+
substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
15+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
17+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
18+
OTHER DEALINGS IN THE SOFTWARE.

MANIFEST.in

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include LICENSE
2+
include versioneer.py
3+
include src/pytask_stata/_version.py
4+
5+
exclude *.rst
6+
exclude *.yml
7+
exclude *.yaml
8+
exclude tox.ini
9+
10+
prune .conda
11+
prune tests

README.rst

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
.. image:: https://img.shields.io/pypi/v/pytask-stata?color=blue
2+
:alt: PyPI
3+
:target: https://pypi.org/project/pytask-stata
4+
5+
.. image:: https://img.shields.io/pypi/pyversions/pytask-stata
6+
:alt: PyPI - Python Version
7+
:target: https://pypi.org/project/pytask-stata
8+
19
.. image:: https://anaconda.org/pytask/pytask-stata/badges/version.svg
210
:target: https://anaconda.org/pytask/pytask-stata
311

412
.. image:: https://anaconda.org/pytask/pytask-stata/badges/platforms.svg
513
:target: https://anaconda.org/pytask/pytask-stata
614

15+
.. image:: https://img.shields.io/pypi/l/pytask-stata
16+
:alt: PyPI - License
17+
718
.. image:: https://github.com/pytask-dev/pytask-stata/workflows/Continuous%20Integration%20Workflow/badge.svg?branch=main
819
:target: https://github.com/pytask-dev/pytask-stata/actions?query=branch%3Amain
920

@@ -28,10 +39,15 @@ Run Stata's do-files with pytask.
2839
Installation
2940
------------
3041

31-
Install the plugin with
42+
pytask-stata is available on `PyPI <https://pypi.org/project/pytask-stata>`_ and
43+
`Anaconda.org <https://anaconda.org/pytask/pytask-stata>`_. Install it with
3244

3345
.. code-block:: console
3446
47+
$ pip install pytask-stata
48+
49+
# or
50+
3551
$ conda config --add channels conda-forge --add channels pytask
3652
$ conda install pytask-stata
3753

codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ coverage:
2222
ignore:
2323
- ".tox/**/*"
2424
- "setup.py"
25+
- "versioneer.py"
26+
- "src/pytask_stata/_version.py"

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ dependencies:
2424
- pytest-cov
2525
- pytest-xdist
2626
- tox-conda
27-
- virtualenv=20.0.33
27+
- versioneer

setup.cfg

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
[bumpversion]
2-
current_version = 0.0.3
3-
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))(\-?((dev)?(?P<dev>\d+))?)
4-
serialize =
5-
{major}.{minor}.{patch}dev{dev}
6-
{major}.{minor}.{patch}
7-
8-
[bumpversion:file:setup.py]
9-
10-
[bumpversion:file:src/pytask_stata/__init__.py]
1+
[versioneer]
2+
VCS = git
3+
style = pep440
4+
versionfile_source = src/pytask_stata/_version.py
5+
versionfile_build = pytask_stata/_version.py
6+
tag_prefix = v
7+
parentdir_prefix = pytask-stata-

setup.py

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
1+
from pathlib import Path
2+
13
from setuptools import find_packages
24
from setuptools import setup
35

6+
import versioneer
7+
8+
9+
README = Path("README.rst").read_text()
10+
11+
PROJECT_URLS = {
12+
"Documentation": "https://github.com/pytask-dev/pytask-stata",
13+
"Github": "https://github.com/pytask-dev/pytask-stata",
14+
"Tracker": "https://github.com/pytask-dev/pytask-stata/issues",
15+
"Changelog": "https://github.com/pytask-dev/pytask-stata/blob/main/CHANGES.rst",
16+
}
17+
18+
419
setup(
520
name="pytask-stata",
6-
version="0.0.3",
21+
version=versioneer.get_version(),
22+
cmd_class=versioneer.get_cmdclass(),
23+
description="Execute do-files with Stata and pytask.",
24+
long_description=README,
25+
long_description_content_type="text/x-rst",
26+
author="Tobias Raabe",
27+
author_email="[email protected]",
28+
python_requires=">=3.6",
29+
license="MIT",
30+
classifiers=[
31+
"Development Status :: 3 - Alpha",
32+
"Operating System :: OS Independent",
33+
"Programming Language :: Python :: 3",
34+
"Programming Language :: Python :: 3 :: Only",
35+
"Programming Language :: Python :: 3.6",
36+
"Programming Language :: Python :: 3.7",
37+
"Programming Language :: Python :: 3.8",
38+
"Programming Language :: Python :: 3.9",
39+
],
40+
platforms="any",
741
packages=find_packages(where="src"),
842
package_dir={"": "src"},
943
entry_points={"pytask": ["pytask_stata = pytask_stata.plugin"]},
44+
zip_false=False,
1045
)

src/pytask_stata/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
__version__ = "0.0.3"
2+
3+
from ._version import get_versions
4+
5+
__version__ = get_versions()["version"]
6+
del get_versions

0 commit comments

Comments
 (0)