Skip to content

Commit

Permalink
Merge pull request #2 from preduus/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
preduus authored Feb 13, 2024
2 parents 87b89b3 + 54b665f commit 3d4a8ff
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 35 deletions.
58 changes: 27 additions & 31 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
name: PyCaseStyle Package Build
name: Publish Python 🐍 distributions 📦 to PyPI

on:
push:
branches:
- main
pull_request:
branches:
- main
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}

- name: Set up Python 3.8
uses: actions/setup-python@v2
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pytest
- name: Build and Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python-version: '3.10'
- name: Install pypa/setuptools
run: >-
python -m
pip install wheel
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
- name: Build a binary wheel
run: >-
python setup.py sdist bdist_wheel
pip install twine
twine upload dist/*
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Installation
To install pycasestyle, you can use pip:

.. code-block:: bash
pip install pycasestyle
Usage
Expand All @@ -24,7 +23,6 @@ Usage
You can import the text formatting styles directly from the pycasestyle module and use them in your code. Here's an example of how to use the text formatting styles:

.. code-block:: python
import pycasestyle
# Converting to camelcase from text
Expand Down Expand Up @@ -68,7 +66,6 @@ You need to migrate information from Postgres to Elasticsearch, however, the map


.. code-block:: python
import pycasestyle
postgres_contract = {
Expand Down
2 changes: 2 additions & 0 deletions pycasestyle/camelcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ def from_dict(self, __dict: dict) -> dict:
camel_case_dict = {}
for key, value in __dict.items():
camel_case_key = self.from_string(key)
if isinstance(value, dict):
value = self.from_dict(value)
camel_case_dict[camel_case_key] = value
return camel_case_dict
2 changes: 2 additions & 0 deletions pycasestyle/kebabcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ def from_dict(self, __dict: dict) -> dict:
kebab_case_dict = {}
for key, value in __dict.items():
kebab_case_key = self.from_string(key)
if isinstance(value, dict):
value = self.from_dict(value)
kebab_case_dict[kebab_case_key] = value
return kebab_case_dict
2 changes: 2 additions & 0 deletions pycasestyle/pascalcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ def from_dict(self, __dict: dict) -> dict:
pascal_case_dict = {}
for key, value in __dict.items():
pascal_case_key = self.from_string(key)
if isinstance(value, dict):
value = self.from_dict(value)
pascal_case_dict[pascal_case_key] = value
return pascal_case_dict
2 changes: 2 additions & 0 deletions pycasestyle/snakecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ def from_dict(self, __dict: dict) -> dict:
snake_case_dict = {}
for key, value in __dict.items():
snake_case_key = self.from_string(key)
if isinstance(value, dict):
value = self.from_dict(value)
snake_case_dict[snake_case_key] = value
return snake_case_dict
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

setup(
name='pycasestyle',
version='0.0.1',
version='{{VERSION_PLACEHOLDER}}',
keywords=['pycasestyle', 'camelcase', 'snakecase', 'pascal case', 'kebab case', 'dict key case', 'string case'],
description='A simple python lib to convert string and dict keys to camelcase, pascal case, kebab case and snake case.',
long_description=readme,
long_description_content_type="text/markdown",
author='Pedro Rodrigues',
author_email='[email protected]',
url='https://github.com/preduus/pycasestyle',
Expand Down

0 comments on commit 3d4a8ff

Please sign in to comment.