-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates setup.py and adds PyPi on GitHub Release
Version is now incremented from the GitHub Action that triggers on a release. Classifiers have been added to the setup.py and .gitignore was updated
- Loading branch information
Showing
5 changed files
with
99 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This workflow 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 | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: PyPi Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
# see: https://github.community/t/how-to-get-just-the-tag-name/16241/7 | ||
- name: Get the version | ||
id: get_version | ||
shell: bash | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Set global variables | ||
shell: bash | ||
run: | | ||
echo "VERSION=${{ steps.get_version.outputs.VERSION}}" >> $GITHUB_ENV | ||
- name: Set __version__ | ||
shell: bash | ||
run: sed -i "s/PLACEHOLDER/${VERSION}/g" "fortls/_version.py" | ||
|
||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to Test PyPi | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish to PyPi | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.pyc | ||
.vscode | ||
.vscode | ||
*.egg-info | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "PLACEHOLDER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,43 @@ | ||
#!/usr/bin/env python | ||
from setuptools import find_packages, setup | ||
from fortls import __version__ | ||
import pathlib | ||
|
||
README = open("README.rst", "r").read() | ||
# The directory containing this file | ||
HERE = pathlib.Path(__file__).resolve().parent | ||
|
||
# The text of the README file is used as a description | ||
README = (HERE / "README.md").read_text() | ||
|
||
NAME = "fortls" | ||
|
||
setup( | ||
name="fortran-language-server", | ||
# Versions should comply with PEP440. For a discussion on single-sourcing | ||
# the version across setup.py and the project code, see | ||
# https://packaging.python.org/en/latest/single_source_version.html | ||
version="1.12.0", | ||
description="FORTRAN Language Server for the Language Server Protocol", | ||
long_description=README, | ||
# The project's main homepage. | ||
url="https://github.com/hansec/fortran-language-server", | ||
download_url=( | ||
"https://github.com/hansec/fortran-language-server/archive/v1.12.0.tar.gz" | ||
), | ||
name=NAME, | ||
version=__version__, | ||
url="https://github.com/gnikit/fortran-language-server", | ||
author="Chris Hansen", | ||
author_email="[email protected]", | ||
description="FORTRAN Language Server - dev version", | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
license="MIT", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Fortran", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
], | ||
# You can just specify the packages manually here if your project is | ||
# simple. Or you can use find_packages(). | ||
packages=find_packages(exclude=["contrib", "docs", "test"]), | ||
|