mirror of
				https://github.com/fastapi-users/fastapi-users.git
				synced 2025-11-04 14:45:50 +08:00 
			
		
		
		
	Remove pipenv and switch to good old pip
This commit is contained in:
		
							
								
								
									
										18
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							@ -24,18 +24,18 @@ jobs:
 | 
				
			|||||||
        python-version: ${{ matrix.python_version }}
 | 
					        python-version: ${{ matrix.python_version }}
 | 
				
			||||||
    - name: Install dependencies
 | 
					    - name: Install dependencies
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        python -m pip install --upgrade pipenv
 | 
					        python -m pip install --upgrade pip
 | 
				
			||||||
        pipenv install --python ${{ matrix.python_version }} --dev
 | 
					        pip install -r requirements.dev.txt
 | 
				
			||||||
    - name: Test with pytest
 | 
					    - name: Test with pytest
 | 
				
			||||||
      env:
 | 
					      env:
 | 
				
			||||||
        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
 | 
					        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        pipenv run pytest --cov=fastapi_users/
 | 
					        pytest --cov=fastapi_users/
 | 
				
			||||||
        pipenv run codecov
 | 
					        codecov
 | 
				
			||||||
    - name: Build and install it on system host
 | 
					    - name: Build and install it on system host
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        pipenv run flit build
 | 
					        flit build
 | 
				
			||||||
        pipenv run flit install --python $(which python)
 | 
					        flit install --python $(which python)
 | 
				
			||||||
        python test_build.py
 | 
					        python test_build.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  release:
 | 
					  release:
 | 
				
			||||||
@ -51,11 +51,11 @@ jobs:
 | 
				
			|||||||
        python-version: 3.7
 | 
					        python-version: 3.7
 | 
				
			||||||
    - name: Install dependencies
 | 
					    - name: Install dependencies
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        python -m pip install --upgrade pipenv
 | 
					        python -m pip install --upgrade pip
 | 
				
			||||||
        pipenv install --dev
 | 
					        pip install -r requirements.dev.txt
 | 
				
			||||||
    - name: Release on PyPI
 | 
					    - name: Release on PyPI
 | 
				
			||||||
      env:
 | 
					      env:
 | 
				
			||||||
        FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
 | 
					        FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
 | 
				
			||||||
        FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
 | 
					        FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        pipenv run flit publish
 | 
					        flit publish
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										19
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								Makefile
									
									
									
									
									
								
							@ -1,32 +1,31 @@
 | 
				
			|||||||
PIPENV_RUN := pipenv run
 | 
					 | 
				
			||||||
MONGODB_CONTAINER_NAME := fastapi-users-test-mongo
 | 
					MONGODB_CONTAINER_NAME := fastapi-users-test-mongo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
isort-src:
 | 
					isort-src:
 | 
				
			||||||
	$(PIPENV_RUN) isort ./fastapi_users ./tests
 | 
						isort ./fastapi_users ./tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
isort-docs:
 | 
					isort-docs:
 | 
				
			||||||
	$(PIPENV_RUN) isort ./docs/src -o fastapi_users
 | 
						isort ./docs/src -o fastapi_users
 | 
				
			||||||
 | 
					
 | 
				
			||||||
format: isort-src isort-docs
 | 
					format: isort-src isort-docs
 | 
				
			||||||
	$(PIPENV_RUN) black .
 | 
						black .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test:
 | 
					test:
 | 
				
			||||||
	docker stop $(MONGODB_CONTAINER_NAME) || true
 | 
						docker stop $(MONGODB_CONTAINER_NAME) || true
 | 
				
			||||||
	docker run -d --rm --name $(MONGODB_CONTAINER_NAME) -p 27017:27017 mongo:4.2
 | 
						docker run -d --rm --name $(MONGODB_CONTAINER_NAME) -p 27017:27017 mongo:4.2
 | 
				
			||||||
	$(PIPENV_RUN) pytest --cov=fastapi_users/ --cov-report=term-missing --cov-fail-under=100
 | 
						pytest --cov=fastapi_users/ --cov-report=term-missing --cov-fail-under=100
 | 
				
			||||||
	docker stop $(MONGODB_CONTAINER_NAME)
 | 
						docker stop $(MONGODB_CONTAINER_NAME)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
docs-serve:
 | 
					docs-serve:
 | 
				
			||||||
	$(PIPENV_RUN) mkdocs serve
 | 
						mkdocs serve
 | 
				
			||||||
 | 
					
 | 
				
			||||||
docs-publish:
 | 
					docs-publish:
 | 
				
			||||||
	$(PIPENV_RUN) mkdocs gh-deploy
 | 
						mkdocs gh-deploy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bumpversion-major:
 | 
					bumpversion-major:
 | 
				
			||||||
	$(PIPENV_RUN) bumpversion major
 | 
						bumpversion major
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bumpversion-minor:
 | 
					bumpversion-minor:
 | 
				
			||||||
	$(PIPENV_RUN) bumpversion minor
 | 
						bumpversion minor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bumpversion-patch:
 | 
					bumpversion-patch:
 | 
				
			||||||
	$(PIPENV_RUN) bumpversion patch
 | 
						bumpversion patch
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										51
									
								
								Pipfile
									
									
									
									
									
								
							
							
						
						
									
										51
									
								
								Pipfile
									
									
									
									
									
								
							@ -1,51 +0,0 @@
 | 
				
			|||||||
[[source]]
 | 
					 | 
				
			||||||
name = "pypi"
 | 
					 | 
				
			||||||
url = "https://pypi.org/simple"
 | 
					 | 
				
			||||||
verify_ssl = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[dev-packages]
 | 
					 | 
				
			||||||
flake8 = "*"
 | 
					 | 
				
			||||||
pytest = "*"
 | 
					 | 
				
			||||||
requests = "*"
 | 
					 | 
				
			||||||
isort = "*"
 | 
					 | 
				
			||||||
databases = {extras = ["sqlite"],version = "*"}
 | 
					 | 
				
			||||||
pytest-asyncio = "*"
 | 
					 | 
				
			||||||
flake8-docstrings = "*"
 | 
					 | 
				
			||||||
mkdocs = "*"
 | 
					 | 
				
			||||||
mkdocs-material = "*"
 | 
					 | 
				
			||||||
black = "*"
 | 
					 | 
				
			||||||
mypy = "*"
 | 
					 | 
				
			||||||
codecov = "*"
 | 
					 | 
				
			||||||
pytest-cov = "*"
 | 
					 | 
				
			||||||
pytest-mock = "*"
 | 
					 | 
				
			||||||
asynctest = "*"
 | 
					 | 
				
			||||||
flit = "*"
 | 
					 | 
				
			||||||
markdown-include = "*"
 | 
					 | 
				
			||||||
pygments = "*"
 | 
					 | 
				
			||||||
pymdown-extensions = "*"
 | 
					 | 
				
			||||||
bumpversion = "*"
 | 
					 | 
				
			||||||
httpx-oauth = "*"
 | 
					 | 
				
			||||||
httpx = "*"
 | 
					 | 
				
			||||||
asgi_lifespan = "*"
 | 
					 | 
				
			||||||
uvicorn = "*"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[packages]
 | 
					 | 
				
			||||||
fastapi = ">=0.54.0,<0.64.0"
 | 
					 | 
				
			||||||
passlib = {extras = ["bcrypt"],version = "==1.7.4"}
 | 
					 | 
				
			||||||
email-validator = ">=1.1.0,<1.2"
 | 
					 | 
				
			||||||
sqlalchemy = ">=1.3.13,<1.4"
 | 
					 | 
				
			||||||
databases = {extras = ["postgresql", "sqlite"], version = ">=0.3.0,<0.5"}
 | 
					 | 
				
			||||||
pyjwt = "==2.0.1"
 | 
					 | 
				
			||||||
python-multipart = "==0.0.5"
 | 
					 | 
				
			||||||
motor = ">=2.2.0,<3.0.0"
 | 
					 | 
				
			||||||
tortoise-orm = ">=0.15.18,<0.17.0"
 | 
					 | 
				
			||||||
ormar = ">=0.9.0,<0.10.0"
 | 
					 | 
				
			||||||
makefun = ">=1.9.2,<1.10"
 | 
					 | 
				
			||||||
typing-extensions = ">=3.7.4.3"
 | 
					 | 
				
			||||||
Deprecated=">=1.2.10,<2.0.0"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[requires]
 | 
					 | 
				
			||||||
python_version = "3.7"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[pipenv]
 | 
					 | 
				
			||||||
allow_prereleases = true
 | 
					 | 
				
			||||||
							
								
								
									
										1280
									
								
								Pipfile.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1280
									
								
								Pipfile.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							@ -97,18 +97,22 @@ This project follows the [all-contributors](https://github.com/all-contributors/
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Development
 | 
					## Development
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Setup environement
 | 
					### Setup environment
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You should have [Pipenv](https://pipenv.readthedocs.io/en/latest/) installed. Then, you can install the dependencies with:
 | 
					You should create a virtual environment and activate it:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
pipenv install --dev
 | 
					python -m venv venv/
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
After that, activate the virtual environment:
 | 
					```bash
 | 
				
			||||||
 | 
					source venv/bin/activate
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					And then install the development dependencies:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
pipenv shell
 | 
					pip install -r requirements.dev.txt
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Run unit tests
 | 
					### Run unit tests
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										26
									
								
								requirements.dev.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								requirements.dev.txt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					-r requirements.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					flake8
 | 
				
			||||||
 | 
					pytest
 | 
				
			||||||
 | 
					requests
 | 
				
			||||||
 | 
					isort
 | 
				
			||||||
 | 
					databases
 | 
				
			||||||
 | 
					pytest-asyncio
 | 
				
			||||||
 | 
					flake8-docstrings
 | 
				
			||||||
 | 
					mkdocs
 | 
				
			||||||
 | 
					mkdocs-material
 | 
				
			||||||
 | 
					black
 | 
				
			||||||
 | 
					mypy
 | 
				
			||||||
 | 
					codecov
 | 
				
			||||||
 | 
					pytest-cov
 | 
				
			||||||
 | 
					pytest-mock
 | 
				
			||||||
 | 
					asynctest
 | 
				
			||||||
 | 
					flit
 | 
				
			||||||
 | 
					markdown-include
 | 
				
			||||||
 | 
					pygments
 | 
				
			||||||
 | 
					pymdown-extensions
 | 
				
			||||||
 | 
					bumpversion
 | 
				
			||||||
 | 
					httpx-oauth
 | 
				
			||||||
 | 
					httpx
 | 
				
			||||||
 | 
					asgi_lifespan
 | 
				
			||||||
 | 
					uvicorn
 | 
				
			||||||
							
								
								
									
										13
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					fastapi >=0.54.0,<0.64.0
 | 
				
			||||||
 | 
					passlib[bcrypt] ==1.7.4
 | 
				
			||||||
 | 
					email-validator >=1.1.0,<1.2
 | 
				
			||||||
 | 
					sqlalchemy >=1.3.13,<1.4
 | 
				
			||||||
 | 
					databases[postgresql, sqlite] >=0.3.0,<0.5
 | 
				
			||||||
 | 
					pyjwt ==2.0.1
 | 
				
			||||||
 | 
					python-multipart ==0.0.5
 | 
				
			||||||
 | 
					motor >=2.2.0,<3.0.0
 | 
				
			||||||
 | 
					tortoise-orm >=0.15.18,<0.17.0
 | 
				
			||||||
 | 
					ormar >=0.9.0,<0.10.0
 | 
				
			||||||
 | 
					makefun >=1.9.2,<1.10
 | 
				
			||||||
 | 
					typing-extensions >=3.7.4.3; python_version < '3.8'
 | 
				
			||||||
 | 
					Deprecated >=1.2.10,<2.0.0
 | 
				
			||||||
		Reference in New Issue
	
	Block a user