Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 605b399

Browse files
authored
Merge pull request #73 from m0nhawk/feat/new-workflows
Feat/new workflows
2 parents 4994566 + 8d19a25 commit 605b399

File tree

11 files changed

+154
-99
lines changed

11 files changed

+154
-99
lines changed

.github/workflows/publish.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,38 @@
1-
name: Publish
1+
name: Publish Python 🐍 distributions 📦 to PyPI, TestPyPI and Anaconda
22

3-
on:
4-
release:
5-
types: [published]
3+
on: push
64

75
jobs:
8-
publish:
6+
build-n-push:
97
runs-on: ubuntu-latest
108
steps:
119
- uses: actions/checkout@v2
12-
- name: Install release dependencies
13-
run: |
14-
python3 -m pip install --upgrade pip
15-
python3 -m pip install setuptools wheel twine
16-
python3 setup.py sdist bdist_wheel
17-
- name: Publish package
18-
uses: pypa/gh-action-pypi-publish@master
1910
with:
20-
user: __token__
11+
fetch-depth: 0
12+
- name: Set up Python 3.7
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.7
16+
- name: Install pep517
17+
run: >-
18+
python -m pip install pep517 --user
19+
- name: Build a binary wheel and a source tarball
20+
run: >-
21+
python -m pep517.build --source --binary --out-dir dist/ .
22+
- name: Publish distribution 📦 to Test PyPI
23+
uses: pypa/gh-action-pypi-publish@v1.3.1
24+
with:
25+
password: ${{ secrets.TEST_PYPI_TOKEN }}
26+
repository_url: https://test.pypi.org/legacy/
27+
- name: Publish distribution 📦 to PyPI
28+
if: startsWith(github.ref, 'refs/tags')
29+
uses: pypa/gh-action-pypi-publish@v1.3.1
30+
with:
2131
password: ${{ secrets.PYPI_TOKEN }}
2232
- name: publish-to-conda
33+
if: startsWith(github.ref, 'refs/tags')
2334
uses: m0nhawk/conda-package-publish-action@master
2435
with:
36+
subDir: './conda'
2537
AnacondaUsername: ${{ secrets.ANACONDA_USERNAME }}
2638
AnacondaPassword: ${{ secrets.ANACONDA_PASSWORD }}

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
python -m pip install poetry
30-
poetry install
29+
python -m pip install .[test]
3130
shell: bash
3231
- name: Run tests
3332
run: |
34-
poetry run coverage run --source grafana_api -m xmlrunner discover -o test-reports
35-
poetry run codecov
33+
coverage run --source grafana_api -m xmlrunner discover -o test-reports
34+
codecov
3635
shell: bash

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# ignore lock file, it's a library
2-
Pipfile.lock
1+
#
2+
grafana_api/version.py
33

44
# Created by .ignore support plugin (hsz.mobi)
55
### Python template

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
## What is this library for?
66

7-
Yet another Grafana API library for Python. Support both 2 and 3 Python versions.
7+
Yet another Grafana API library for Python. Support Python 3 only.
88

99
## Requirements
1010

11-
You need either 2nd or 3rd version of Python and only the `requests` library installed.
11+
You need Python 3 and only the `requests` library installed.
1212

1313
## Quick start
1414

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

conda/conda_setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from setuptools import setup
2+
from grafana_api.version import version
3+
setup(
4+
version=version,
5+
)

conda/meta.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{% set data = load_setup_py_data(setup_file='conda_setup.py') %}
2+
{% set version = data.get('version') %}
3+
4+
package:
5+
name: grafana_api
6+
version: {{ version }}
7+
8+
source:
9+
path: ..
10+
11+
build:
12+
noarch: python
13+
number: 0
14+
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv
15+
16+
requirements:
17+
host:
18+
- python
19+
- requests
20+
run:
21+
- python
22+
- requests
23+
24+
test:
25+
imports:
26+
- grafana_api
27+
- grafana_api.api
28+
29+
about:
30+
home: https://m0nhawk.github.io/grafana_api/
31+
license: MIT
32+
license_family: MIT
33+
license_file: LICENSE
34+
summary: Yet another Python library for Grafana API
35+
doc_url: https://m0nhawk.github.io/grafana_api/
36+
dev_url: https://m0nhawk.github.io/grafana_api/
37+
38+
extra:
39+
recipe-maintainers:
40+
- m0nhawk

meta.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

pyproject.toml

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
[tool.poetry]
2-
name = "grafana_api"
3-
version = "1.0.2"
4-
description = "Yet another Python library for Grafana API"
5-
authors = ["Andrew Prokhorenkov <andrew.prokhorenkov@gmail.com>"]
6-
license = "MIT"
7-
classifiers = [
8-
"Development Status :: 4 - Beta",
9-
"Intended Audience :: Developers",
10-
"Topic :: Internet",
11-
"Topic :: Software Development :: Libraries",
12-
"Topic :: Software Development :: Libraries :: Python Modules",
13-
"Operating System :: OS Independent",
14-
"License :: OSI Approved :: MIT License",
15-
"Programming Language :: Python :: 3",
16-
"Programming Language :: Python :: 3.6",
17-
"Programming Language :: Python :: 3.7",
18-
"Programming Language :: Python :: 3.8"
19-
]
20-
21-
[tool.poetry.dependencies]
22-
python = "^3.6"
23-
requests = "^2.23.0"
24-
25-
[tool.poetry.dev-dependencies]
26-
codecov = "^2.1.8"
27-
coverage = "^5.2.1"
28-
unittest-xml-reporting = "^3.0.2"
29-
requests-mock = "^1.8.0"
30-
311
[build-system]
32-
requires = ["poetry>=0.12"]
33-
build-backend = "poetry.masonry.api"
2+
requires = [
3+
"pip>=20.0",
4+
"setuptools>=40.0",
5+
"setuptools_scm[toml]>=4.0",
6+
"wheel"
7+
]
8+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[metadata]
2+
name = grafana_api
3+
friendly_name = Python Grafana API
4+
description = Yet another Python library for Grafana API
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
7+
license = MIT
8+
license_file = LICENSE
9+
author = Andrew Prokhorenkov
10+
author_email = andrew.prokhorenkov@gmail.com
11+
copyright = Copyright 2017-2020 Andrew Prokhorenkov <andrew.prokhorenkov@gmail.com>
12+
url = https://github.com/m0nhawk/grafana_api/
13+
project_urls =
14+
Source = https://github.com/m0nhawk/grafana_api/
15+
Tracker = https://github.com/m0nhawk/grafana_api/issues
16+
classifiers =
17+
Development Status :: 4 - Beta
18+
Intended Audience :: Developers
19+
License :: OSI Approved :: MIT License
20+
Operating System :: OS Independent
21+
Programming Language :: Python :: 3
22+
Programming Language :: Python :: 3.6
23+
Programming Language :: Python :: 3.7
24+
Programming Language :: Python :: 3.8
25+
Topic :: Internet
26+
Topic :: Software Development
27+
Topic :: Software Development :: Libraries
28+
Topic :: Software Development :: Libraries :: Python Modules
29+
keywords = grafana api
30+
31+
[options]
32+
use_scm_version = True
33+
python_requires = >=3.6
34+
packages = find:
35+
include_package_data = True
36+
zip_safe = False
37+
setup_requires =
38+
setuptools_scm>=4.0
39+
40+
install_requires =
41+
requests>=2.23.0
42+
43+
[options.extras_require]
44+
test =
45+
codecov>=2.1.0
46+
coverage>=5.2.0
47+
unittest-xml-reporting>=3.0.0
48+
requests-mock>=1.8.0
49+
50+
[options.packages.find]
51+
where = .
52+
exclude = test
53+
54+
[bdist_wheel]
55+
universal = true
56+
57+
[tool.setuptools_scm]
58+
local_scheme = no-local-version
59+
version_scheme = python-simplified-semver
60+
write_to = grafana_api/version.py

0 commit comments

Comments
 (0)