Skip to content

Commit

Permalink
Merge pull request #12 from Ouranosinc/modernize
Browse files Browse the repository at this point in the history
Modernize library
  • Loading branch information
Zeitsperre authored Jul 12, 2024
2 parents d42f317 + ed2c250 commit 86ffb68
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 121 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Python 🐍 distributions 📦 to PyPI

on:
release:
types:
- published

permissions:
contents: read

jobs:
deploy_pypi:
name: Build and publish Python 🐍 distributions 📦 to PyPI
environment: production
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: "0"
- name: Set up Python3
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.x"
- name: Install Flit
run: |
python -m pip install flit
- name: Build a binary wheel and a source tarball
run: |
python -m flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0

26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.idea
*.pyc
*.swp
env/
build/
dist/
env/
requests_magpie.egg-info/
.idea
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
David Caron
Francis Charette-Migneault
Trevor James Smith
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Changelog
=========

0.3.0
-----

- Dropped support for Python 3.6 and 3.7.
- Now using the `flit` backend for library packaging.
- Now using Trusted Publisher workflow for PyPI releases and Dependabot for dependency updates.
- Licensing notices have been updated to reflect the current year and maintainers.

0.2.0
-----

- Add parameter to provide extra request keyword arguments as needed for performing the authentication request.
- Add parameter to cache result from authentication request to avoid performing the opeartion each time.

0.1.1
-----

- Initial Release
13 changes: 0 additions & 13 deletions HISTORY.rst

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2019 David Caron
Copyright (c) 2019-2024, David Caron, Francis Charette-Migneault, Trevor James Smith

Permission to use, copy, modify and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

56 changes: 56 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[build-system]
requires = ["flit>=3.9,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "requests-magpie"
description = "A Magpie authentication handler for python-requests"
readme = { file = "README.rst", content-type = "text/x-rst" }
license = { file = "LICENSE" }
authors = [
{ name = "David Caron" }
]
maintainers = [
{ name = "Trevor James Smith", email = "[email protected]" },
{ name = "Francis Charette-Migneault", email = "[email protected]" }
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: ISC License (ISCL)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dynamic = ["version"]
dependencies = [
"requests >=2.32.2"
]

[project.optional-dependencies]
dev = ["pytest"]

[project.urls]
"Homepage" = "https://github.com/Ouranosinc/requests-magpie"
"Issue tracker" = "https://github.com/Ouranosinc/requests-magpie/issues"
"About Ouranos" = "https://www.ouranos.ca/en/"

[tool.flit.sdist]
include = [
"AUTHORS",
"CHANGELOG",
"LICENSE",
"README.rst",
"tests/*.py",
]
exclude = [
".*",
]
8 changes: 4 additions & 4 deletions requests_magpie.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ISC License
#
# Copyright (c) 2019 David Caron
# Copyright (c) 2019-2024, David Caron, Francis Charette-Migneault, Trevor James Smith
#
# Permission to use, copy, modify and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand All @@ -17,8 +17,8 @@
requests Magpie authentication library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. This library
adds optional Magpie authentication support. Basic GET usage:
Requests is an HTTP library, written in Python, for human beings.
This library adds optional Magpie authentication support. Basic GET usage:
>>> import requests
>>> from requests_magpie import MagpieAuth
Expand All @@ -34,7 +34,7 @@
from requests.cookies import merge_cookies
from requests.exceptions import RequestException

__version__ = '0.2.0'
__version__ = '0.3.0'


class MagpieAuthenticationError(RequestException):
Expand Down
2 changes: 0 additions & 2 deletions requirements-test.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

65 changes: 0 additions & 65 deletions setup.py

This file was deleted.

File renamed without changes.

0 comments on commit 86ffb68

Please sign in to comment.