-
-
Notifications
You must be signed in to change notification settings - Fork 8
Add python implemetation #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,27 @@ | ||
| --- | ||
| name: Upload Python Package | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| push: | ||
| branches: | ||
| - release/* | ||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip build twine | ||
| - name: Build and publish | ||
| working-directory: ./python | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
| run: | | ||
| python -m build | ||
| twine upload dist/* | ||
This file contains hidden or 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,48 @@ | ||
| --- | ||
| name: test-python | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| push: | ||
| branches: | ||
| - main | ||
| - renovate/** | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -U setuptools | ||
| pip install tox tox-gh-actions codecov | ||
| - name: Test with tox | ||
| working-directory: ./python | ||
| run: | | ||
| tox | ||
| codecov | ||
| - name: Build checking | ||
| working-directory: ./python | ||
| if: "matrix.python-version == '3.11'" | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
| run: | | ||
| python -m pip install --upgrade build twine | ||
| python -m build | ||
| twine check dist/* |
This file contains hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| *.rej | ||
| *.py[cod] | ||
| /.env | ||
| *.orig | ||
| **/__pycache__ | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Packages | ||
| *.egg | ||
| *.egg-info | ||
| dist | ||
| build | ||
| _build | ||
| eggs | ||
| parts | ||
| bin | ||
| var | ||
| sdist | ||
| develop-eggs | ||
| .installed.cfg | ||
| lib | ||
| lib64 | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
|
|
||
| # Unit test / coverage reports | ||
| .coverage | ||
| .tox | ||
| nosetests.xml | ||
|
|
||
| # Translations | ||
| *.mo | ||
|
|
||
| # Mr Developer | ||
| .mr.developer.cfg | ||
| .project | ||
| .pydevproject | ||
| .pytest_cache | ||
| .ropeproject | ||
|
|
||
| # Sublime | ||
| /*.sublime-* | ||
|
|
||
| #PyCharm | ||
| /.idea | ||
|
|
||
| # virtualenv | ||
| /.Python | ||
| /lib | ||
| /include | ||
| /share | ||
| /local |
This file contains hidden or 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,48 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| --- | ||
| repos: | ||
| - repo: https://github.com/psf/black | ||
| rev: 23.3.0 | ||
| hooks: | ||
| - id: black | ||
| args: | ||
| - "python/src/ci_environment" | ||
| - "python/tests" | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.12.0 | ||
| hooks: | ||
| - id: isort | ||
| name: isort (python) | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-added-large-files | ||
| - id: check-toml | ||
| - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
| rev: v2.9.0 | ||
| hooks: | ||
| - id: pretty-format-toml | ||
| args: [--autofix] | ||
| - repo: https://github.com/asottile/pyupgrade | ||
| rev: v3.7.0 | ||
| hooks: | ||
| - id: pyupgrade | ||
| args: ["--py38-plus"] | ||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.4.1 | ||
| hooks: | ||
| - id: mypy | ||
| additional_dependencies: [types-setuptools, types-certifi] | ||
| - repo: https://github.com/tox-dev/tox-ini-fmt | ||
| rev: "1.3.1" | ||
| hooks: | ||
| - id: tox-ini-fmt | ||
| - repo: https://github.com/adrienverge/yamllint.git | ||
| rev: v1.32.0 | ||
| hooks: | ||
| - id: yamllint | ||
| args: [--format, parsable, --strict] |
This file contains hidden or 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,3 @@ | ||
| # CiEnvironment | ||
|
|
||
| Python implementation of https://github.com/cucumber/ci-environment |
This file contains hidden or 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,67 @@ | ||
| [build-system] | ||
| build-backend = "setuptools.build_meta" | ||
| requires = ["setuptools", "wheel"] | ||
|
|
||
| [project] | ||
| authors = [ | ||
| {name = "Cucumber Limited", email = "[email protected]"} | ||
| ] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Framework :: Gherkin", | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: POSIX", | ||
| "Operating System :: Microsoft :: Windows", | ||
| "Operating System :: MacOS :: MacOS X", | ||
| "Topic :: Utilities", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11" | ||
| ] | ||
| dependencies = [ | ||
| "importlib_resources", | ||
| "python-dotenv" | ||
| ] | ||
| description = "This library detects the CI environment based on environment variables defined by CI servers." | ||
| readme = {file = "README.md", content-type = "text/markdown"} | ||
| license = {text = "MIT"} | ||
| maintainers = [ | ||
| {name = "Konstantin Goloveshko", email = "[email protected]"} | ||
| ] | ||
| name = "gherkin-ci-environment" | ||
| requires-python = ">=3.8" | ||
| urls = {Repository = "https://github.com/cucumber/ci-environment"} | ||
| version = "0.1.0" | ||
|
|
||
| [project.entry-points] | ||
|
|
||
| [project.scripts] | ||
|
|
||
| [tool.black] | ||
| line-length = 120 | ||
| target-version = ["py38", "py39", "py310", "py311"] | ||
| verbose = true | ||
|
|
||
| [tool.isort] | ||
| line_length = 120 | ||
| multi_line_output = 3 | ||
| profile = "black" | ||
|
|
||
| [tool.mypy] | ||
| files = "src/ci_environment/**/*.py" | ||
| install_types = true | ||
| non_interactive = true | ||
| plugins = [ | ||
| "pydantic.mypy" | ||
| ] | ||
| show_error_codes = true | ||
| warn_return_any = true | ||
| warn_unused_configs = true | ||
|
|
||
| [[tool.mypy.overrides]] | ||
| ignore_missing_imports = true | ||
| module = [ | ||
| ] |
This file contains hidden or 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,5 @@ | ||
| [pytest] | ||
| testpaths = tests | ||
| filterwarnings = | ||
| error | ||
| ignore::DeprecationWarning |
This file contains hidden or 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,15 @@ | ||
| [options] | ||
| include_package_data = True | ||
| packages = find: | ||
| package_dir = | ||
| =src | ||
|
|
||
| [options.packages.find] | ||
| where = src | ||
| [options.package_data] | ||
| ci_environment = | ||
| CiEnvironments.json | ||
|
|
||
| [options.extras_require] | ||
| test = | ||
| tox |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blaisep can you remove this file from main and resubmit it in a PR?
We currently don't have anything to publish to PyPI. Once that is setup the PR to enable python releases can be made.