Skip to content

Commit

Permalink
ci: changes for packaging and publishing library (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
shimizust authored Feb 15, 2023
1 parent 5a71b93 commit 043cc4e
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 10 deletions.
18 changes: 17 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,20 @@ If there are code changes that might affect the example code ([/examples](exampl

## Testing

From the project root directory, run `pytest`.
From the project root directory, run `pytest`.

## Publishing Package to PyPI

Pre-requisites:
- Create an account on TestPyPI
- Create an account on PyPI

1. Create source archive and a wheel for the package: `python -m build`
2. If you've made changes to pyproject.toml, run a check to make sure package metadata will be rendered properly on PyPI: `twine check dist/*`
3. If you want to test the package upload first:
1. Upload to TestPyPI (enter your account credentials): `twine upload -r testpypi dist/*`
2. [Search](https://test.pypi.org/search/) for your package on TestPyPI and confirm it looks good.
3. Install and test out the published test package in a local project: `python -m pip install -i https://test.pypi.org/simple linkedin-api-client`
4. Note: You cannot overwrite existing versions in TestPyPI or PyPI, so for testing, you would need to increment the version if it already exists.
4. Once everything looks good, upload to PyPI: `twine upload dist/*`

2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ flask = "*"
pytest = "*"
python-dotenv = "*"
responses = "*"
build = "*"
twine = "*"

[requires]
python_version = "3.10"
189 changes: 182 additions & 7 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "linkedin-api-client"
version = "0.1.0"
description = "Official Python client library for LinkedIn APIs"
readme = "README.md"
license = {file = "LICENSE.md"}
keywords = ["linkedin", "api", "rest.li"]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
dependencies = ["requests"]
requires-python = ">=3.7"

[project.urls]
Homepage = "https://github.com/linkedin-developers/linkedin-api-python-client"
repository = "https://github.com/linkedin-developers/linkedin-api-python-client"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

setup(
name='linkedin-api-client',
packages=find_packages(include=['linkedin_api_client','examples']),
version='0.0.1',
packages=find_packages(exclude=['tests']),
version='0.1.0',
description='LinkedIn API Python client library',
author='LinkedIn',
install_requires=['requests'],
Expand Down

0 comments on commit 043cc4e

Please sign in to comment.