Skip to content

Commit e55099f

Browse files
authored
Merge branch 'developer' into insert-parcial-similarity-functions
2 parents 96c2391 + 4e13445 commit e55099f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7691
-7674
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 10 deletions
This file was deleted.

.code-style.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ We following the [Numpy](https://numpydoc.readthedocs.io/en/latest/format.html)
2222
## flake8
2323

2424
Flake8 is a python linter that helps to keep the code up to PEP standards.
25+
26+
## mypy
27+
28+
Mypy is a static type checker for python
29+
2530
To lint the code, run: `make lint`
2631

2732
## Pre-Commit
@@ -85,13 +90,14 @@ pymove/core/dataframe.py:970:29: E711 comparison to None should be 'if cond is N
8590

8691
- Don't commit to branch: Doesn't allow direct commits to `master` branch.
8792

88-
- seed isort known_third_party: Populates the `.isort.cfg` file.
8993

9094
- isort: Sorts the imports.
9195

9296
- flake8: Ensures that the code follows `pylint` and `pyflakes` guidelines.
9397
It will point the errors in the code.
9498

99+
- mypy: Performs type checking.
100+
It will point the errors in the code.
95101
---
96102

97103
## Codacy

.deployment-instructions.md

Lines changed: 107 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -10,101 +10,85 @@
1010

1111
The link in this tutorial will explain the steps to upload a package to pypi: <https://dzone.com/articles/executable-package-pip-install>
1212

13-
#### Get started with Travis CI
14-
15-
1. Sing up on Travis-ci with GitHub.
16-
17-
2. Accept the authorization of Travis CI.
18-
19-
3. Click on your profile picture in the top right of your Travis Dashboard,
20-
click the green Activate button, and select the repositories
21-
you want to use with Travis CI.
22-
23-
4. Add a .travis.yml file to your repository to tell Travis CI what to do.
24-
25-
#### Use the .travis.yml file to configure your deploy
26-
27-
5. Create an API token to authenticate with PyPI:
28-
1. In your Pypi account settings, go to API tokens section and
29-
select "Add API token"
30-
31-
2. Add the token to the Github Actions Secret.
32-
33-
6. Create a github action with the following content:
34-
```yaml
35-
name: Publish to PyPI
36-
on:
37-
push:
38-
tags:
39-
- "*"
40-
41-
jobs:
42-
build-n-publish:
43-
if: github.event.base_ref == 'refs/heads/<branch-for-deploy>' && startsWith(github.ref, 'refs/tags')
44-
name: Build and publish package
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: actions/checkout@v2
48-
- name: Set up Python 3.6
49-
uses: actions/setup-python@v2
50-
with:
51-
python-version: 3.6
52-
- name: Install dependencies
53-
run: |
54-
python -m pip install --upgrade "pip<20"
55-
pip install -r requirements-dev.txt
56-
- name: <optional step to lint and test the code>
57-
run: |
58-
flake8
59-
pytest
60-
- name: Build
61-
run: |
62-
pip install setuptools wheel twine
63-
python setup.py sdist bdist_wheel
64-
- name: Publish
65-
uses: pypa/gh-action-pypi-publish@master
66-
with:
67-
user: __token__
68-
password: ${{ secrets.pypi_password }}
69-
```
13+
#### Use Github Actions to deploy
14+
15+
1. Create an API token to authenticate with PyPI:
16+
- In your Pypi account settings, go to API tokens section and select "Add API token"
17+
18+
- Add the token to the Github Actions Secret.
19+
20+
2. Create a github workflow with the following content:
21+
```yaml
22+
name: Publish to PyPI
23+
on:
24+
push:
25+
tags:
26+
- "*"
27+
28+
jobs:
29+
build-n-publish:
30+
if: github.event.base_ref == 'refs/heads/<branch-for-deploy>' && startsWith(github.ref, 'refs/tags')
31+
name: Build and publish package
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Set up Python 3.6
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: 3.6
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
make dev
43+
- name: <optional step to lint and test the code>
44+
run: |
45+
make lint
46+
make test
47+
- name: Build
48+
run: |
49+
pip install setuptools wheel twine
50+
python setup.py sdist bdist_wheel
51+
- name: Publish
52+
uses: pypa/gh-action-pypi-publish@master
53+
with:
54+
user: __token__
55+
password: ${{ secrets.pypi_password }}
56+
```
7057
7158
#### Configure bump2version
7259
7360
For the versioning control we a using the package bump2version.
7461
7562
1. Run `pip install bump2version` in your environment
76-
2. Add the following attributes to the .bumpversion.cfg file:
77-
```yaml
78-
[bumpversion]
79-
current_version = <version_number>
80-
allow_dirty = True
81-
tag_name = version-{new_version}
82-
tag = True
83-
commit = True
84-
[bumpversion:file:<path_to_file_version_file>]
63+
2. Add the following attributes to the setup.cfg file:
64+
```conf
65+
[bumpversion]
66+
current_version = <version_number>
67+
allow_dirty = True
68+
tag_name = version-{new_version}
69+
tag = True
70+
commit = True
71+
[bumpversion:file:<path_to_file_version_file>]
72+
[bumpversion:file:<path_to_setup_file>]
8573
```
8674

8775
***Note:*** If `NotADirectoryError: [Errno 20] Not a directory`,
8876
check <https://github.com/c4urself/bump2version/issues/139> for a fix.
8977

9078
#### For more information see these links
9179

92-
- <https://docs.travis-ci.com/user/tutorial/>
9380
- <https://docs.travis-ci.com/user/deployment/pypi/>
9481
- <https://github.com/c4urself/bump2version>
9582

9683
---
9784

98-
### Deploy the package using Travis CI
99-
100-
1. Run the command `bumperversion [major|minor|patch]` to increase the
101-
version number. This will create a new tag and commit the changes.
85+
1. Run the command `bumperversion [major|minor|patch]` to increase the version number.
86+
This will create a new tag and commit the changes.
10287

10388
2. Push the changes to the developer branch.
10489

10590
3. Create a pull request onto master. To deploy pymove to Pypi using
106-
you must be in the master branch, Travis was configured to only allow
107-
deployments from tagged commits on the master branch.
91+
you must be in the master branch, pushing a tagged commit.
10892

10993
4. After merging the new version into the master branch, push the new
11094
tag created by bump2version.
@@ -133,76 +117,76 @@ With the package published to Pypi, we can easily deploy to the
133117

134118
2. Now add some information to the `<package_name>/meta.yaml` file.
135119
```yaml
136-
{% set name = <package_name> %}
137-
{% set version = <package_version> %}
138-
139-
package:
140-
name: "{{ name|lower }}"
141-
version: "{{ version }}"
142-
143-
source:
144-
url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
145-
sha256: <package_version_sha256>
146-
147-
build:
148-
number: 0
149-
script: "{{ PYTHON }} -m pip install . -vv"
150-
noarch: python
151-
152-
requirements:
153-
host:
154-
- pip
155-
- python >=3.6
156-
run:
157-
- <package_requirements>
158-
- python >=3.6
159-
160-
test:
161-
imports:
162-
- <all_possible_imports>
163-
164-
about:
165-
home: <repository_url>
166-
license: <licence>
167-
license_family: <licence_family>
168-
license_file: <path_to_licence_file>
169-
summary: <package_summary>
170-
doc_url: <package_docs_url>
171-
dev_url:
172-
173-
extra:
174-
recipe-maintainers:
175-
- <your_github_username>
176-
- <other_package_maintainers>
120+
{% set name = <package_name> %}
121+
{% set version = <package_version> %}
122+
123+
package:
124+
name: "{{ name|lower }}"
125+
version: "{{ version }}"
126+
127+
source:
128+
url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
129+
sha256: <package_version_sha256>
130+
131+
build:
132+
number: 0
133+
script: "{{ PYTHON }} -m pip install . -vv"
134+
noarch: python
135+
136+
requirements:
137+
host:
138+
- pip
139+
- python >=3.6
140+
run:
141+
- <package_requirements>
142+
- python >=3.6
143+
144+
test:
145+
imports:
146+
- <all_possible_imports>
147+
148+
about:
149+
home: <repository_url>
150+
license: <licence>
151+
license_family: <licence_family>
152+
license_file: <path_to_licence_file>
153+
summary: <package_summary>
154+
doc_url: <package_docs_url>
155+
dev_url:
156+
157+
extra:
158+
recipe-maintainers:
159+
- <your_github_username>
160+
- <other_package_maintainers>
177161
```
178162

179-
1. All package run requirements must be avaiable in the conda-forge channel.
163+
All package run requirements must be available in the conda-forge channel.
180164

181165
#### Request the publication to the conda-forge channel
182166

183-
2. Fork the example recipes repository at <https://github.com/conda-forge/staged-recipes>
167+
1. Fork the example recipes repository at <https://github.com/conda-forge/staged-recipes>
184168

185-
3. Copy the `<package_name>/meta.yaml` file created in the step above to
169+
2. Copy the `<package_name>/meta.yaml` file created in the step above to
186170
the forked repo `staged-recipes/recipes/example` directory
187171

188-
4. Push the changes to your forked repository.
172+
3. Push the changes to your forked repository.
189173

190-
5. Make a pull request for your repository to the master branch on
174+
4. Make a pull request for your repository to the master branch on
191175
the stage-recipes repository.
192176
- `conda-forge:master from <your_github_username>:<package_name>`
193177

194-
6. Now, the pull request will be checked.
195-
- Comlete the checklist for the pull requests.
178+
5. Now, the pull request will be checked.
179+
- Complete the checklist for the pull requests.
196180

197181
- The recipe meta.yaml file will be checked by the `conda-forge-linting service`.
198182

199183
- The recipe will be built for `linux64`, `macos64`
200184
and `windows64` systems.
201185

202-
7. If there are any problems with the PR, a review team member will give
186+
6. If there are any problems with the PR, a review team member will give
203187
you feedback, pointing out improvements and answering questions.
204188

205-
8. Once everything is in order, the pull request will be aproved.
189+
7. Once everything is in order, the pull request will be aproved.
206190

207191
---
208192

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/lint_and_test.yml

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,26 @@ name: Lint and Test
22
on: [push]
33

44
jobs:
5-
lint:
6-
name: Code Linting
5+
lint-test:
6+
name: Lint and Test
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ['3.7', '3.8', '3.9']
811
steps:
9-
- uses: actions/checkout@main
10-
- name: Set up Python 3.7
11-
uses: actions/setup-python@main
12-
with:
13-
python-version: 3.7
14-
- name: Install dependencies
15-
run: |
16-
python -m pip install --upgrade pip
17-
make dev
18-
- name: Lint
19-
working-directory: ${{ github.workspace }}
20-
run: |
21-
make lint
22-
test:
23-
name: Code Testing
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@main
27-
- name: Set up Python 3.7
28-
uses: actions/setup-python@main
29-
with:
30-
python-version: 3.7
31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
make dev
35-
- name: Test
36-
working-directory: ${{ github.workspace }}
37-
run: |
38-
make test
12+
- uses: actions/checkout@main
13+
- uses: actions/setup-python@main
14+
with:
15+
python-version: ${{ matrix.python-version }}
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
make dev
20+
- name: Check code style
21+
working-directory: ${{ github.workspace }}
22+
run: |
23+
make lint
24+
- name: Runs unit tests
25+
working-directory: ${{ github.workspace }}
26+
run: |
27+
make test

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dev:
1313

1414
clean:
1515
rm -rf `find . -type d -name .pytest_cache`
16+
rm -rf `find . -type d -name .mypy_cache`
1617
rm -rf `find . -type d -name __pycache__`
1718
rm -rf `find . -type d -name .ipynb_checkpoints`
1819
rm -rf docs/_build

0 commit comments

Comments
 (0)