Skip to content

Commit

Permalink
Merge pull request #1 from pescheckit/initial-branch
Browse files Browse the repository at this point in the history
Added required package files
  • Loading branch information
uberfresh authored Jan 29, 2024
2 parents 6d33050 + bd42a3b commit 33c7fed
Show file tree
Hide file tree
Showing 38 changed files with 5,485 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 120
exclude = migrations/*,node_modules/*,.venv/*
max-complexity = 12

185 changes: 185 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: CI

on:
push:
branches:
- main # Change this to the default branch of your repository
pull_request:
branches:
- main # Change this to the default branch of your repository
release:
types: [published]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Pipenv
run: |
python -m pip install --upgrade pip
pip install pipenv ruff
- name: Install dependencies with Pipenv
run: |
pipenv install --dev
- name: Analysing the code with pylint
run: |
pipenv run pylint django_country_kit dev project
- name: Check code style with flake8
run: |
pipenv run flake8 .
- name: Check import order with isort
run: |
pipenv run isort --check-only --diff .
- name: Linting with Ruff
run: |
ruff .
build_django_50:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
django-version: ["5.0"]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies and setuptools
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
- name: Install specific Django version
run: pip install Django==${{ matrix.django-version }}

- name: Run tests
run: |
python manage.py test
- name: Build distribution package
run: python setup.py sdist

- name: Archive distribution package
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.tar.gz

build_django_42:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9"]
django-version: ["4.2"]

needs: build_django_50

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install specific Django version
run: pip install Django==${{ matrix.django-version }}

- name: Run tests
run: |
python manage.py test
- name: Build distribution package
run: python setup.py sdist

- name: Archive distribution package
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.tar.gz

build_django_32:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
django-version: ["3.2"]

needs: build_django_42

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install specific Django version
run: pip install Django==${{ matrix.django-version }}

- name: Run tests
run: |
python manage.py test
- name: Build distribution package
run: python setup.py sdist

- name: Archive distribution package
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.tar.gz

deploy:
needs: build_django_32
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment: release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install Pipenv
run: python -m pip install --upgrade pipenv
- name: Install dependencies with Pipenv
run: |
pipenv install --dev
- name: Build package
run: pipenv run python -m build
- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: dist/
142 changes: 142 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Django #
*.log
*.pot
*.pyc
__pycache__
db.sqlite3
media

# Backup files #
*.bak

# Static files #
static/

# If you are using PyCharm #
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# File-based project format
*.iws

# IntelliJ
out/

# JIRA plugin
atlassian-ide-plugin.xml

# Python #
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.whl
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Sublime Text #
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history
.ruff_cache
16 changes: 16 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[MASTER]
ignore=migrations, manage.py
max-line-length=120

[MESSAGES CONTROL]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time.
#enable=

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
disable=too-few-public-methods, no-member, protected-access
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include *.rst
include LICENSE
include django_country_kit/locale
exclude tox.ini
17 changes: 17 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = ">=3.2"

[dev-packages]
django-extensions = "~=3.2.3"
pylint = "*"
flake8 = "*"
isort = "*"
ruff = "*"

[requires]
python_version = "3.10"
Loading

0 comments on commit 33c7fed

Please sign in to comment.